]> err.no Git - scalable-opengroupware.org/commitdiff
Added ZideStore -> UI-X -> Scheduler
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 7 Jun 2004 08:49:26 +0000 (08:49 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 7 Jun 2004 08:49:26 +0000 (08:49 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@11 d1b88da0-ebda-0310-925b-ed51d893ca5b

26 files changed:
ZideStore/UI-X/ChangeLog [new file with mode: 0644]
ZideStore/UI-X/Scheduler/GNUmakefile [new file with mode: 0644]
ZideStore/UI-X/Scheduler/GNUmakefile.postamble [new file with mode: 0644]
ZideStore/UI-X/Scheduler/NOTES [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoAppointmentView.h [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoAppointmentView.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoAppointmentView.wox [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoAptTableView.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoAptTableView.wox [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalMonthOverview.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalMonthView.h [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalMonthView.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalView.h [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalView.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalWeekOverview.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalWeekView.h [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalWeekView.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/SchedulerUIProduct.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/Version [new file with mode: 0644]
ZideStore/UI-X/Scheduler/bundle-info.plist [new file with mode: 0644]
ZideStore/UI-X/Scheduler/common.h [new file with mode: 0644]
ZideStore/UI-X/Scheduler/images/next_week.gif [new file with mode: 0644]
ZideStore/UI-X/Scheduler/images/previous_week.gif [new file with mode: 0644]
ZideStore/UI-X/Scheduler/product.plist [new file with mode: 0644]

diff --git a/ZideStore/UI-X/ChangeLog b/ZideStore/UI-X/ChangeLog
new file mode 100644 (file)
index 0000000..ef4e0e4
--- /dev/null
@@ -0,0 +1,33 @@
+2004-06-03  Helge Hess  <helge.hess@opengroupware.org>
+
+       * Scheduler/OGoCalWeekOverview.m: moved navigation URL generation to
+         superclass (now generic because we use the 'ownMethodName'). Could
+         even be moved to OGoCalView?
+       
+       * Scheduler/OGoCalMonthView.m: added next/prev month URL generation
+         methods, calculate startdate from form value
+
+       * Scheduler/OGoCalView.m: added -ownMethodName method to return the
+         last path component of the request URL (the SOPE method), eg
+         'weekoverview' for OGoCalWeekView, added 
+         -dateNavigationURLWithNewStartDate: method to calculate 'startDate'
+         URLs (should be improved to include existing query parameters!)
+
+       * Scheduler/OGoCalWeekOverview.m: minor tweaks ;-)
+
+2004-06-03  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Scheduler/OGoCalWeekView.m: construct startDate from formValue,
+         otherwise use current week's monday as startDate.
+
+       * Scheduler/OGoCalWeekOverview.wox: switch back/forth
+
+       * Scheduler/OGoCalWeekOverview.m: provide URLs for switching back/forth
+         weekoverview.
+
+       * Scheduler/OGoCalView.[hm]: methods for converting dates into strings
+         and vice versa.
+
+       * Scheduler/OGoAppointmentView.m, Scheduler/OGoCalView.m: fixed include
+
+       * ChangeLog: created
diff --git a/ZideStore/UI-X/Scheduler/GNUmakefile b/ZideStore/UI-X/Scheduler/GNUmakefile
new file mode 100644 (file)
index 0000000..05cd3b9
--- /dev/null
@@ -0,0 +1,53 @@
+# $Id: GNUmakefile,v 1.4 2004/06/04 16:15:23 znek Exp $
+
+include $(GNUSTEP_MAKEFILES)/common.make
+
+BUNDLE_NAME        = SchedulerUI
+BUNDLE_EXTENSION   = .zsp
+BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/ZideStore12
+
+SchedulerUI_PRINCIPAL_CLASS = SchedulerUIProduct
+
+SchedulerUI_OBJC_FILES = \
+       SchedulerUIProduct.m    \
+       OGoCalView.m            \
+       OGoCalWeekView.m        \
+       OGoCalMonthView.m       \
+       OGoAptTableView.m       \
+       \
+       OGoCalWeekOverview.m    \
+       OGoCalMonthOverview.m   \
+       OGoAppointmentView.m    \
+
+SchedulerUI_RESOURCE_FILES += \
+       Version                                                                         \
+       product.plist                                                   \
+       \
+       OGoAptTableView.wox                             \
+       OGoCalWeekOverview.wox          \
+       OGoCalMonthOverview.wox         \
+       OGoAppointmentView.wox          \
+       images/next_week.gif                    \
+       images/previous_week.gif        \
+
+ZIDESTORE=../..
+
+ADDITIONAL_INCLUDE_DIRS += \
+       -I. \
+       -I$(ZIDESTORE)/Frontend -I$(ZIDESTORE)/Backend -I$(ZIDESTORE)
+
+# make
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/bundle.make
+-include GNUmakefile.postamble
+
+ifneq ($(GNUSTEP_BUILD_DIR),)
+after-all ::
+       @(cp bundle-info.plist \
+         $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION))
+else
+after-all ::
+       @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\
+         cp ../bundle-info.plist .)
+endif
diff --git a/ZideStore/UI-X/Scheduler/GNUmakefile.postamble b/ZideStore/UI-X/Scheduler/GNUmakefile.postamble
new file mode 100644 (file)
index 0000000..6e5a7f2
--- /dev/null
@@ -0,0 +1,10 @@
+# $Id: GNUmakefile.postamble,v 1.1 2004/05/12 14:45:56 helge Exp $
+
+validate-wox:
+       xmllint --noout *.wox
+
+before-all :: validate-wox
+
+after-all ::
+       @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\
+         cp ../bundle-info.plist .)
diff --git a/ZideStore/UI-X/Scheduler/NOTES b/ZideStore/UI-X/Scheduler/NOTES
new file mode 100644 (file)
index 0000000..478e898
--- /dev/null
@@ -0,0 +1,12 @@
+// $Id: NOTES,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+URLs
+====
+
+/zidestore/ControlPanel/                       => SoControlPanel
+/zidestore/ControlPanel/Products               => SoProductRegistry
+/zidestore/ControlPanel/Products/ZideStoreUI   => SoProduct
+/zidestore/ControlPanel/Products/ZideStoreUI/Resources/
+=> SoProductResourceManager
+/zidestore/ControlPanel/Products/ZideStoreUI/Resources/calendar.css
+=> resource
diff --git a/ZideStore/UI-X/Scheduler/OGoAppointmentView.h b/ZideStore/UI-X/Scheduler/OGoAppointmentView.h
new file mode 100644 (file)
index 0000000..b4a220d
--- /dev/null
@@ -0,0 +1,14 @@
+// $Id: OGoAppointmentView.h,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+#ifndef __ZideStoreUI_OGoAppointmentView_H__
+#define __ZideStoreUI_OGoAppointmentView_H__
+
+#include <NGObjWeb/SoComponent.h>
+
+@interface OGoAppointmentView : SoComponent
+{
+}
+
+@end
+
+#endif /* __ZideStoreUI_OGoAppointmentView_H__ */
diff --git a/ZideStore/UI-X/Scheduler/OGoAppointmentView.m b/ZideStore/UI-X/Scheduler/OGoAppointmentView.m
new file mode 100644 (file)
index 0000000..23f5b34
--- /dev/null
@@ -0,0 +1,23 @@
+// $Id: OGoAppointmentView.m,v 1.2 2004/06/03 16:42:38 znek Exp $
+
+#include "OGoAppointmentView.h"
+#include "common.h"
+#include <Backend/SxAptManager.h>
+
+@interface NSObject(UsedPrivates)
+- (SxAptManager *)aptManagerInContext:(id)_ctx;
+@end
+
+@implementation OGoAppointmentView
+
+- (void)dealloc {
+  [super dealloc];
+}
+
+/* backend */
+
+- (SxAptManager *)aptManager {
+  return [[self clientObject] aptManagerInContext:[self context]];
+}
+
+@end /* OGoAppointmentView */
diff --git a/ZideStore/UI-X/Scheduler/OGoAppointmentView.wox b/ZideStore/UI-X/Scheduler/OGoAppointmentView.wox
new file mode 100644 (file)
index 0000000..8599707
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version='1.0' standalone='yes'?>
+<var:component className="OGoPageFrame" title="name"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+>
+  <a href="../weekoverview" >week</a>
+  <a href="../monthoverview">month</a>
+  <br />
+    <h4>Appointment Viewer</h4>
+    OGo ZideStore Server - <var:string value="name"/>
+    <br />
+    Client: <var:string value="clientObject"/>
+    <br />
+    Group:      <var:string value="clientObject.group"/><br />
+    Deletable:  <var:string value="clientObject.isDeletionAllowed"/><br />
+    Generation: <var:string value="clientObject.zlGenerationCount"/><br />
+    MsgClass:   <var:string value="clientObject.outlookMessageClass"/><br />
+    
+    <hr />
+    
+    As iCal:<br />
+    <pre><var:string value="clientObject.iCalString"/></pre>
+
+    <hr />
+
+    As Mail:<br />
+    <pre><var:string value="clientObject.iCalMailString"/></pre>
+</var:component>
diff --git a/ZideStore/UI-X/Scheduler/OGoAptTableView.m b/ZideStore/UI-X/Scheduler/OGoAptTableView.m
new file mode 100644 (file)
index 0000000..ad4bf53
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+  Copyright (C) 2000-2003 SKYRIX Software AG
+
+  This file is part of OGo
+
+  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.
+*/
+// $Id: OGoAptTableView.m,v 1.1 2003/11/24 01:37:06 helge Exp $
+
+#include <NGObjWeb/SoComponent.h>
+
+@class NSArray, NSCalendarDate;
+
+@interface OGoAptTableView : SoComponent
+{
+  NSArray *appointments;
+  id      appointment;
+}
+
+/* accessors */
+
+- (NSArray *)appointments;
+- (id)appointment;
+
+@end
+
+#include "common.h"
+
+@implementation OGoAptTableView
+
+- (void)dealloc {
+  [self->appointment  release];
+  [self->appointments release];
+  [super dealloc];
+}
+
+/* accessors */
+
+- (void)setAppointments:(NSArray *)_apts {
+  ASSIGN(self->appointments, _apts);
+}
+- (NSArray *)appointments {
+  return self->appointments;
+}
+
+- (void)setAppointment:(id)_apt {
+  ASSIGN(self->appointment, _apt);
+}
+- (id)appointment {
+  return self->appointment;
+}
+
+- (NSString *)appointmentViewURL {
+  id pkey;
+  
+  if ((pkey = [[self appointment] valueForKey:@"dateId"]) == nil)
+    return nil;
+  
+  return [NSString stringWithFormat:@"%@/view", pkey];
+}
+
+@end /* OGoAptTableView */
diff --git a/ZideStore/UI-X/Scheduler/OGoAptTableView.wox b/ZideStore/UI-X/Scheduler/OGoAptTableView.wox
new file mode 100644 (file)
index 0000000..e270edf
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version='1.0' standalone='yes'?>
+<table
+  style="font-size: 11px;"
+  border="0" cellspacing="0" cellpadding="2"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+>
+  <tr>
+    <th>ID</th>
+    <th>Title</th>
+    <th>Time</th>
+    <th>Version</th>
+    <th>Location</th>
+  </tr>
+  <var:foreach list="appointments" item="appointment">
+    <tr>
+      <td><var:string value="appointment.dateId"/></td>
+      <td>
+        <a var:href="appointmentViewURL"
+          ><var:string value="appointment.title"/></a>
+      </td>
+      <td>
+        <var:string value="appointment.startDate"
+                    const:dateformat="%Y-%m-%d %H:%M" />
+        -
+        <var:string value="appointment.endDate"
+                    const:dateformat="%Y-%m-%d %H:%M" />
+      </td>
+      <td><var:string value="appointment.objectVersion"/></td>
+      <td><var:string value="appointment.location"/></td>
+    </tr>
+  </var:foreach>
+</table>
diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.m b/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.m
new file mode 100644 (file)
index 0000000..d2146a7
--- /dev/null
@@ -0,0 +1,19 @@
+// $Id: OGoCalMonthOverview.m,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+#include "OGoCalMonthView.h"
+
+@interface OGoCalMonthOverview : OGoCalMonthView
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation OGoCalMonthOverview
+
+- (NSArray *)appointments {
+  return [self fetchCoreInfos];
+}
+
+@end /* OGoCalMonthOverview */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox b/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox
new file mode 100644 (file)
index 0000000..6b98aee
--- /dev/null
@@ -0,0 +1,45 @@
+<?xml version='1.0' standalone='yes'?>
+<var:component className="OGoPageFrame" title="name"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+>
+  <a href="weekoverview">week</a>
+  <br />
+    OGo ZideStore Server - <var:string value="name"/>
+    <br />
+    Client: <var:string value="clientObject"/>
+    <br />
+    Appointments: #<var:string value="appointments.count"/>
+    from <var:string value="startDate" />
+    to   <var:string value="endDate" />
+    <br />
+
+    <hr />
+    
+    <a var:href="prevMonthURL"><var:entity const:name="lt" /><var:entity const:name="lt" /></a>
+    <a var:href="thisMonthURL">*</a>
+    <a var:href="nextMonthURL"><var:entity const:name="gt" /><var:entity const:name="gt" /></a>
+    <br />
+    <var:month-overview
+      list="appointments"
+      item="appointment"
+      weekStart="weekStart"
+      const:startDateKey = "startDate"
+      const:endDateKey   = "endDate"
+      const:titleColor   = "#7799FF"
+      const:contentColor = "#5577FF"
+    >
+      <var:month>
+       <a var:href="appointmentViewURL"
+          ><var:string value="appointment.title" /></a>
+      </var:month>
+    </var:month-overview>
+
+    <hr />
+
+    Appointments: 
+    <var:component className="OGoAptTableView" appointments="appointments"/>
+
+    <!-- pre><var:string value="appointments" const:insertBR="YES"/></pre -->
+</var:component>
diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthView.h b/ZideStore/UI-X/Scheduler/OGoCalMonthView.h
new file mode 100644 (file)
index 0000000..a4ba3ac
--- /dev/null
@@ -0,0 +1,20 @@
+// $Id: OGoCalMonthView.h,v 1.2 2004/06/03 21:56:44 helge Exp $
+
+#ifndef __ZideStoreUI_OGoCalMonthView_H__
+#define __ZideStoreUI_OGoCalMonthView_H__
+
+#include "OGoCalView.h"
+
+/*
+  OGoCalMonthView
+  
+  Abstract superclass for views which display months.
+*/
+
+@interface OGoCalMonthView : OGoCalView
+{
+}
+
+@end
+
+#endif /* __ZideStoreUI_OGoCalMonthView_H__ */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthView.m b/ZideStore/UI-X/Scheduler/OGoCalMonthView.m
new file mode 100644 (file)
index 0000000..a1496bc
--- /dev/null
@@ -0,0 +1,52 @@
+// $Id: OGoCalMonthView.m,v 1.2 2004/06/03 21:56:44 helge Exp $
+
+#include "OGoCalMonthView.h"
+#include "common.h"
+
+@implementation OGoCalMonthView
+
+// TODO: look how to properly calculate month range!
+
+- (NSCalendarDate *)startDate {
+  // TODO: copy of the startdate method
+  NSCalendarDate *startDate;
+  NSString *dateString;
+  
+  dateString = [[[self context] request] formValueForKey:@"startDate"];
+  startDate = dateString
+    ? [self dateForDateString:dateString]
+    : [[NSCalendarDate date] mondayOfWeek];
+  
+  return startDate;
+}
+- (NSCalendarDate *)endDate {
+  return [[self startDate] dateByAddingYears:0 months:0 days:31
+                          hours:0 minutes:0 seconds:0];
+}
+
+/* URLs (TODO: fix scroll ranges for months!) */
+
+- (NSString *)prevMonthURL {
+  NSCalendarDate *newMonthDate;
+  
+  newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:-31
+                                  hours:0 minutes:0 seconds:0];
+  return [self dateNavigationURLWithNewStartDate:newMonthDate];
+}
+
+- (NSString *)nextMonthURL {
+  NSCalendarDate *newMonthDate;
+  
+  newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:31
+                                  hours:0 minutes:0 seconds:0];
+  return [self dateNavigationURLWithNewStartDate:newMonthDate];
+}
+
+- (NSString *)thisMonthURL {
+  NSCalendarDate *newMonthDate;
+  
+  newMonthDate = [[NSCalendarDate date] mondayOfWeek];
+  return [self dateNavigationURLWithNewStartDate:newMonthDate];
+}
+
+@end /* OGoCalMonthView */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalView.h b/ZideStore/UI-X/Scheduler/OGoCalView.h
new file mode 100644 (file)
index 0000000..a5d9974
--- /dev/null
@@ -0,0 +1,46 @@
+// $Id: OGoCalView.h,v 1.3 2004/06/03 21:56:44 helge Exp $
+
+#ifndef __ZideStoreUI_OGoCalView_H__
+#define __ZideStoreUI_OGoCalView_H__
+
+#include <NGObjWeb/SoComponent.h>
+
+@class NSArray, NSCalendarDate;
+@class SxAptManager, SxAptSetIdentifier;
+
+@interface OGoCalView : SoComponent
+{
+  NSArray *appointments;
+  id      appointment;
+}
+
+/* accessors */
+
+- (NSArray *)appointments;
+- (id)appointment;
+
+/* URLs */
+
+- (NSString *)appointmentViewURL;
+- (NSString *)ownMethodName;
+- (NSString *)dateNavigationURLWithNewStartDate:(NSCalendarDate *)_newDate;
+
+/* backend */
+
+- (SxAptManager *)aptManager;
+- (SxAptSetIdentifier *)aptSetID;
+
+/* fetching */
+
+- (NSCalendarDate *)startDate;
+- (NSCalendarDate *)endDate;
+- (NSArray *)fetchGIDs;
+- (NSArray *)fetchCoreInfos;
+
+/* date selection */
+- (NSString *)dateStringForDate:(NSCalendarDate *)_date;
+- (NSCalendarDate *)dateForDateString:(NSString *)_dateString;
+
+@end
+
+#endif /* __ZideStoreUI_OGoCalView_H__ */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalView.m b/ZideStore/UI-X/Scheduler/OGoCalView.m
new file mode 100644 (file)
index 0000000..2888ec5
--- /dev/null
@@ -0,0 +1,156 @@
+// $Id: OGoCalView.m,v 1.3 2004/06/03 21:56:44 helge Exp $
+
+#include "OGoCalView.h"
+#include "common.h"
+#include <Backend/SxAptManager.h>
+
+@interface NSObject(UsedPrivates)
+- (SxAptManager *)aptManagerInContext:(id)_ctx;
+@end
+
+@implementation OGoCalView
+
+- (void)dealloc {
+  [self->appointment  release];
+  [self->appointments release];
+  [super dealloc];
+}
+
+/* accessors */
+
+- (void)setAppointments:(NSArray *)_apts {
+  ASSIGN(self->appointments, _apts);
+}
+- (NSArray *)appointments {
+  return self->appointments;
+}
+
+- (void)setAppointment:(id)_apt {
+  ASSIGN(self->appointment, _apt);
+}
+- (id)appointment {
+  return self->appointment;
+}
+
+/* URLs */
+
+- (NSString *)appointmentViewURL {
+  id pkey;
+  
+  if ((pkey = [[self appointment] valueForKey:@"dateId"]) == nil)
+    return nil;
+  
+  return [NSString stringWithFormat:@"%@/view", pkey];
+}
+
+- (NSString *)ownMethodName {
+  NSString *uri;
+  NSRange  r;
+  
+  uri = [[[self context] request] uri];
+  
+  /* first: cut off query parameters */
+  
+  r = [uri rangeOfString:@"?" options:NSBackwardsSearch];
+  if (r.length > 0)
+    uri = [uri substringToIndex:r.location];
+  
+  /* next: strip trailing slash */
+
+  if ([uri hasSuffix:@"/"]) uri = [uri substringToIndex:([uri length] - 1)];
+  r = [uri rangeOfString:@"/" options:NSBackwardsSearch];
+
+  /* then: cut of last path component */
+  
+  if (r.length == 0) // no slash? are we at root?
+    return @"/";
+  
+  return [uri substringFromIndex:(r.location + 1)];
+}
+
+- (NSString *)dateNavigationURLWithNewStartDate:(NSCalendarDate *)_newDate {
+  return [NSString stringWithFormat:@"%@?startDate=%@",
+                    [self ownMethodName], 
+                    [self dateStringForDate:_newDate]];
+}
+
+/* backend */
+
+- (SxAptManager *)aptManager {
+  return [[self clientObject] aptManagerInContext:[self context]];
+}
+- (SxAptSetIdentifier *)aptSetID {
+  return [[self clientObject] aptSetID];
+}
+
+/* resource URLs (TODO?) */
+
+- (NSString *)resourcePath {
+  return @"/ZideStore.woa/WebServerResources/";
+}
+
+- (NSString *)favIconPath {
+  return [[self resourcePath] stringByAppendingPathComponent:@"favicon.ico"];
+}
+- (NSString *)cssPath {
+  NSString *path;
+  
+  // TODO: there should be reusable functionality for that!
+  path = @"ControlPanel/Products/ZideStoreUI/Resources/zidestoreui.css";
+  return [[self context] urlWithRequestHandlerKey:@"so"
+                        path:path
+                        queryString:nil];
+}
+
+- (NSString *)calCSSPath {
+  NSString *path;
+  
+  // TODO: there should be reusable functionality for that!
+  path = @"ControlPanel/Products/ZideStoreUI/Resources/calendar.css";
+  return [[self context] urlWithRequestHandlerKey:@"so"
+                        path:path
+                        queryString:nil];
+}
+
+/* fetching */
+
+- (NSCalendarDate *)startDate {
+  return [NSCalendarDate date];
+}
+- (NSCalendarDate *)endDate {
+  return [[NSCalendarDate date] tomorrow];
+}
+
+- (NSArray *)fetchGIDs {
+  return [[self aptManager] gidsOfAppointmentSet:[self aptSetID]
+                            from:[self startDate] to:[self endDate]];
+}
+
+- (NSArray *)fetchCoreInfos {
+  NSArray *gids;
+  
+  if (self->appointments)
+    return self->appointments;
+  
+  [self logWithFormat:@"fetching (%@ => %@) ...", 
+         [self startDate], [self endDate]];
+  gids = [self fetchGIDs];
+  [self logWithFormat:@"  %i GIDs ...", [gids count]];
+  
+  self->appointments = 
+    [[[self aptManager] coreInfoOfAppointmentsWithGIDs:gids
+                        inSet:[self aptSetID]] retain];
+  
+  [self logWithFormat:@"fetched %i records.", [self->appointments count]];
+  return self->appointments;
+}
+
+- (NSString *)dateStringForDate:(NSCalendarDate *)_date {
+  return [_date descriptionWithCalendarFormat:@"%Y%m%d"];
+}
+
+- (NSCalendarDate *)dateForDateString:(NSString *)_dateString {
+  return [NSCalendarDate dateWithString:_dateString calendarFormat:@"%Y%m%d"];
+}
+  
+@end /* OGoCalView */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.m b/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.m
new file mode 100644 (file)
index 0000000..f254f13
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+  Copyright (C) 2000-2004 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.
+*/
+// $Id: OGoCalWeekOverview.m,v 1.3 2004/06/03 21:56:44 helge Exp $
+
+#include "OGoCalWeekView.h"
+
+@interface OGoCalWeekOverview : OGoCalWeekView
+{
+}
+
+@end
+
+#include "common.h"
+#include <Backend/SxAptManager.h>
+
+@implementation OGoCalWeekOverview
+
+- (NSArray *)appointments {
+  return [self fetchCoreInfos];
+}
+
+@end /* OGoCalWeekOverview */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox b/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox
new file mode 100644 (file)
index 0000000..c07e87f
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version='1.0' standalone='yes'?>
+<var:component className="OGoPageFrame" title="name"
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:var="http://www.skyrix.com/od/binding"
+  xmlns:const="http://www.skyrix.com/od/constant"
+  xmlns:rsrc="OGo:url"
+>
+  <a href="monthoverview">month</a>
+  <br />
+    OGo ZideStore Server - <var:string value="name"/>
+    <br />
+    Client: <var:string value="clientObject"/>
+    <br />
+    Appointments: #<var:string value="appointments.count"/>
+    <br />
+
+    <hr />
+
+    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+      <tr bgcolor="#E0E0E0">
+        <td align="left" valign="middle" width="80%">other stuff</td> <!-- 99% -->
+        <td align="right"><table border="0"><tr>
+        <td align="right" valign="middle"><a var:href="prevWeekURL"><img rsrc:src="previous_week.gif" alt="previous week" border="0" /></a></td>
+        <td align="right" valign="middle"><a var:href="thisWeekURL" class="button_auto">this<var:entity const:name="nbsp" />week</a></td>
+        <td align="right" valign="middle"><a var:href="nextWeekURL"><img rsrc:src="next_week.gif" alt="next week" border="0" /></a></td>
+        </tr></table></td>
+      </tr>
+    </table>
+    <br />
+    <var:week-overview
+      list="appointments"
+      item="appointment"
+      weekStart="startDate"
+      const:startDateKey = "startDate"
+      const:endDateKey   = "endDate"
+      const:titleStyle   = "weekoverview_title"
+      const:contentStyle = "weekoverview_content"
+    >
+      <var:week>
+       <a var:href="appointmentViewURL"
+          ><var:string value="appointment.title" /></a>
+      </var:week>
+    </var:week-overview>
+
+    <hr />
+    
+    Appointments: 
+    <var:component className="OGoAptTableView" appointments="appointments"/>
+    
+    <!-- pre><var:string value="appointments" const:insertBR="YES"/></pre -->
+</var:component>
diff --git a/ZideStore/UI-X/Scheduler/OGoCalWeekView.h b/ZideStore/UI-X/Scheduler/OGoCalWeekView.h
new file mode 100644 (file)
index 0000000..4800509
--- /dev/null
@@ -0,0 +1,19 @@
+// $Id: OGoCalWeekView.h,v 1.2 2004/06/03 21:56:44 helge Exp $
+
+#ifndef __ZideStoreUI_OGoCalWeekView_H__
+#define __ZideStoreUI_OGoCalWeekView_H__
+
+#include "OGoCalView.h"
+
+@interface OGoCalWeekView : OGoCalView
+{
+}
+
+/* URLs */
+
+- (NSString *)prevWeekURL;
+- (NSString *)nextWeekURL;
+
+@end
+
+#endif /* __ZideStoreUI_OGoCalWeekView_H__ */
diff --git a/ZideStore/UI-X/Scheduler/OGoCalWeekView.m b/ZideStore/UI-X/Scheduler/OGoCalWeekView.m
new file mode 100644 (file)
index 0000000..310ec86
--- /dev/null
@@ -0,0 +1,50 @@
+// $Id: OGoCalWeekView.m,v 1.3 2004/06/03 21:56:44 helge Exp $
+
+#include "OGoCalWeekView.h"
+#include "common.h"
+
+@implementation OGoCalWeekView
+
+- (NSCalendarDate *)startDate {
+  NSCalendarDate *startDate;
+  NSString *dateString;
+  
+  dateString = [[[self context] request] formValueForKey:@"startDate"];
+  startDate = dateString
+    ? [self dateForDateString:dateString]
+    : [[NSCalendarDate date] mondayOfWeek];
+  
+  return startDate;
+}
+
+- (NSCalendarDate *)endDate {
+  return [[self startDate] dateByAddingYears:0 months:0 days:7
+                          hours:0 minutes:0 seconds:0];
+}
+
+/* URLs */
+
+- (NSString *)prevWeekURL {
+  NSCalendarDate *newWeekDate;
+  
+  newWeekDate = [[self startDate] dateByAddingYears:0 months:0 days:-7 
+                                  hours:0 minutes:0 seconds:0];
+  return [self dateNavigationURLWithNewStartDate:newWeekDate];
+}
+
+- (NSString *)nextWeekURL {
+  NSCalendarDate *newWeekDate;
+  
+  newWeekDate = [[self startDate] dateByAddingYears:0 months:0 days:7 
+                                  hours:0 minutes:0 seconds:0];
+  return [self dateNavigationURLWithNewStartDate:newWeekDate];
+}
+
+- (NSString *)thisWeekURL {
+  NSCalendarDate *newWeekDate;
+  
+  newWeekDate = [[NSCalendarDate date] mondayOfWeek];
+  return [self dateNavigationURLWithNewStartDate:newWeekDate];
+}
+
+@end /* OGoCalWeekView */
diff --git a/ZideStore/UI-X/Scheduler/SchedulerUIProduct.m b/ZideStore/UI-X/Scheduler/SchedulerUIProduct.m
new file mode 100644 (file)
index 0000000..7666ef0
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  Copyright (C) 2000-2003 SKYRIX Software AG
+
+  This file is part of OGo
+
+  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.
+*/
+// $Id: SchedulerUIProduct.m,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+#import <Foundation/NSObject.h>
+
+@interface SchedulerUIProduct : NSObject
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation SchedulerUIProduct
+@end /* SchedulerUIProduct */
diff --git a/ZideStore/UI-X/Scheduler/Version b/ZideStore/UI-X/Scheduler/Version
new file mode 100644 (file)
index 0000000..d64ce5a
--- /dev/null
@@ -0,0 +1,5 @@
+# $Id: Version,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+SUBMINOR_VERSION:=1
+
+# 1.1.0 requires NGObjWeb 4.2.202
diff --git a/ZideStore/UI-X/Scheduler/bundle-info.plist b/ZideStore/UI-X/Scheduler/bundle-info.plist
new file mode 100644 (file)
index 0000000..44a5c52
--- /dev/null
@@ -0,0 +1,20 @@
+{
+  "__cvs__" = "$Id: bundle-info.plist,v 1.1 2003/11/24 01:24:40 helge Exp $";
+
+  requires = {
+    bundleManagerVersion = 1;
+    classes = (
+      { name = NSObject;    }
+    );
+  };
+
+  provides = {
+    ZideStoreProducts = ( { name = SchedulerUIProduct; } );
+    
+    classes = (
+    );
+
+    WOComponents = (
+    );
+  };
+}
diff --git a/ZideStore/UI-X/Scheduler/common.h b/ZideStore/UI-X/Scheduler/common.h
new file mode 100644 (file)
index 0000000..d179d30
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  Copyright (C) 2000-2003 SKYRIX Software AG
+
+  This file is part of OGo
+
+  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.
+*/
+// $Id: common.h,v 1.1 2003/11/24 01:24:40 helge Exp $
+
+#import <Foundation/Foundation.h>
+
+#if LIB_FOUNDATION_LIBRARY
+#  import <Foundation/exceptions/GeneralExceptions.h>
+#elif NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
+#  import <FoundationExt/NSObjectMacros.h>
+#  import <FoundationExt/NSString+Ext.h>
+#  import <FoundationExt/GeneralExceptions.h>
+#endif
+
+#include <NGExtensions/NGExtensions.h>
+#include <NGObjWeb/NGObjWeb.h>
+#include <NGObjWeb/SoObjects.h>
diff --git a/ZideStore/UI-X/Scheduler/images/next_week.gif b/ZideStore/UI-X/Scheduler/images/next_week.gif
new file mode 100644 (file)
index 0000000..bacfdb0
Binary files /dev/null and b/ZideStore/UI-X/Scheduler/images/next_week.gif differ
diff --git a/ZideStore/UI-X/Scheduler/images/previous_week.gif b/ZideStore/UI-X/Scheduler/images/previous_week.gif
new file mode 100644 (file)
index 0000000..5f1a0da
Binary files /dev/null and b/ZideStore/UI-X/Scheduler/images/previous_week.gif differ
diff --git a/ZideStore/UI-X/Scheduler/product.plist b/ZideStore/UI-X/Scheduler/product.plist
new file mode 100644 (file)
index 0000000..5056806
--- /dev/null
@@ -0,0 +1,35 @@
+{
+  requires = ( MAIN, CommonUI );
+
+  publicResources = (
+    previous_week.gif,
+    next_week.gif
+  );
+
+  factories = {
+  };
+
+  categories = {
+    SxAppointmentFolder = {
+      methods = {
+        "weekoverview" = { 
+          protectedBy = "View";
+          pageName    = "OGoCalWeekOverview"; 
+        };
+        "monthoverview" = { 
+          protectedBy = "View";
+          pageName    = "OGoCalMonthOverview"; 
+        };
+      };
+    };
+
+    SxAppointment = {
+      methods = {
+        "view" = { 
+          protectedBy = "View";
+          pageName    = "OGoAppointmentView"; 
+        };
+      };
+    };
+  };
+}