]> err.no Git - sope/commitdiff
started HelloForm
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 11 Jul 2005 14:14:42 +0000 (14:14 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 11 Jul 2005 14:14:42 +0000 (14:14 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@883 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/samples/HelloForm/ChangeLog [new file with mode: 0644]
sope-appserver/samples/HelloForm/GNUmakefile [new file with mode: 0644]
sope-appserver/samples/HelloForm/GNUmakefile.preamble [new file with mode: 0644]
sope-appserver/samples/HelloForm/HelloWorld.m [new file with mode: 0644]
sope-appserver/samples/HelloForm/Main.m [new file with mode: 0644]
sope-appserver/samples/HelloForm/Main.wo/Main.html [new file with mode: 0644]
sope-appserver/samples/HelloForm/Main.wo/Main.wod [new file with mode: 0644]
sope-appserver/samples/HelloForm/common.h [new file with mode: 0644]

diff --git a/sope-appserver/samples/HelloForm/ChangeLog b/sope-appserver/samples/HelloForm/ChangeLog
new file mode 100644 (file)
index 0000000..eb60fc5
--- /dev/null
@@ -0,0 +1,4 @@
+2005-07-11  Helge Hess  <helge.hess@opengroupware.org>
+
+       * created by copying HelloWorld
+
diff --git a/sope-appserver/samples/HelloForm/GNUmakefile b/sope-appserver/samples/HelloForm/GNUmakefile
new file mode 100644 (file)
index 0000000..294501f
--- /dev/null
@@ -0,0 +1,13 @@
+# GNUstep makefile
+
+-include ../../../config.make
+include $(GNUSTEP_MAKEFILES)/common.make
+
+WOAPP_NAME = HelloForm
+
+HelloForm_OBJC_FILES += HelloForm.m Main.m
+HelloForm_COMPONENTS += Main.wo
+
+-include GNUmakefile.preamble
+include $(GNUSTEP_MAKEFILES)/woapp.make
+-include GNUmakefile.postamble
diff --git a/sope-appserver/samples/HelloForm/GNUmakefile.preamble b/sope-appserver/samples/HelloForm/GNUmakefile.preamble
new file mode 100644 (file)
index 0000000..76f949a
--- /dev/null
@@ -0,0 +1,9 @@
+# compile settings
+
+# static references required for Mach linker
+
+ADDITIONAL_TOOL_LIBS += \
+       -lEOControl                     \
+       -lDOM -lXmlRpc -lSaxObjC
+
+ADDITIONAL_LIB_DIRS += -L/usr/local/lib -L/usr/lib
diff --git a/sope-appserver/samples/HelloForm/HelloWorld.m b/sope-appserver/samples/HelloForm/HelloWorld.m
new file mode 100644 (file)
index 0000000..0f83375
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+  Copyright (C) 2004-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 <NGObjWeb/WOApplication.h>
+
+@interface HelloForm : WOApplication
+{
+}
+
+@end
+
+#include "common.h"
+
+@implementation HelloForm
+@end /* HelloForm */
+
+int main(int argc, char **argv, char **env) {
+  NSAutoreleasePool *pool;
+
+  pool = [[NSAutoreleasePool alloc] init];
+#if LIB_FOUNDATION_LIBRARY
+  [NSProcessInfo initializeWithArguments:argv count:argc environment:env];
+#endif
+  
+  WOApplicationMain(@"HelloForm", argc, (void*)argv);
+
+  [pool release];
+  return 0;
+}
diff --git a/sope-appserver/samples/HelloForm/Main.m b/sope-appserver/samples/HelloForm/Main.m
new file mode 100644 (file)
index 0000000..0817fc0
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+  Copyright (C) 2000-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 <NGObjWeb/WOComponent.h>
+
+@class NSArray;
+
+@interface Main : WOComponent
+{
+  NSArray *items;
+  id      item;
+}
+
+@end
+
+#include "common.h"
+
+@implementation Main
+
+- (id)initWithContext:(id)_ctx {
+  if ((self = [super initWithContext:_ctx])) {
+    NSMutableArray *ma;
+    int i;
+
+    ma = [[NSMutableArray alloc] init];
+    for (i = 0; i < 1000; i++) {
+      char buf[16];
+      NSString *s;
+      sprintf(buf, "%i", i);
+      s = [[NSString alloc] initWithCString:buf];
+      [ma addObject:s];
+      [s release];
+    }
+    self->items = ma;
+  }
+  return self;
+}
+
+- (void)dealloc {
+  [self->items release];
+  [self->item  release];
+  [super dealloc];
+}
+
+/* accessors */
+
+- (void)setItem:(id)_item {
+  ASSIGN(self->item, _item);
+}
+- (id)item {
+  return self->item;
+}
+
+- (NSArray *)list {
+  return self->items;
+}
+
+/* response generation */
+
+- (void)appendToResponse:(WOResponse *)_r inContext:(WOContext *)_ctx {
+  NSDate *s;
+
+  s = [NSDate date];
+  [super appendToResponse:_r inContext:_ctx];
+  printf("duration: %.3f\n", [[NSDate date] timeIntervalSinceDate:s]);
+}
+
+@end /* Main */
diff --git a/sope-appserver/samples/HelloForm/Main.wo/Main.html b/sope-appserver/samples/HelloForm/Main.wo/Main.html
new file mode 100644 (file)
index 0000000..bbca2e3
--- /dev/null
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
+<HTML>
+  <HEAD>
+    <META NAME="generator" CONTENT="SOPE 4.2">
+    <TITLE>Hello World</TITLE>
+  </HEAD>
+  <BODY BGCOLOR="#FFFFFF">
+    <h2>Hello World</h2>
+
+    Application Name: 
+    <#AppName/> (Hash),
+    <WEBOBJECT NAME="AppName"></WEBOBJECT> (WO)
+  </BODY>
+</HTML>
diff --git a/sope-appserver/samples/HelloForm/Main.wo/Main.wod b/sope-appserver/samples/HelloForm/Main.wo/Main.wod
new file mode 100644 (file)
index 0000000..e79ffd9
--- /dev/null
@@ -0,0 +1,5 @@
+// $Id$
+
+AppName: WOString {
+  value = application.name;
+}
\ No newline at end of file
diff --git a/sope-appserver/samples/HelloForm/common.h b/sope-appserver/samples/HelloForm/common.h
new file mode 100644 (file)
index 0000000..1312749
--- /dev/null
@@ -0,0 +1,3 @@
+
+#import <Foundation/Foundation.h>
+#include <NGObjWeb/NGObjWeb.h>