2001-12-11 Manuel Guesdon <mguesdon@orange-concept.com>

* GSWeb.framework/GSWResourceManager.m: logs
	* GSWeb.framework/GSWDefaultAdaptorThread.m: logs
		corrected bug in response writing
	* GSWeb.framework/GSWApplication.m: logs
	* GSWAdaptors/common/GSWHTTPResponse.c: logs
	* added Example/hello 'application'


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@11702 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Manuel Guesdon 2001-12-11 14:35:30 +00:00
parent 95068eec21
commit ae58cc295f
25 changed files with 664 additions and 182 deletions

View file

@ -0,0 +1,54 @@
#
# examples makefile for the GNUstep Base Library
#
# Copyright (C) 1997 Free Software Foundation, Inc.
#
# Written by: Scott Christley <scottc@net-community.com>
#
# This file is part of the GNUstep Base Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Install into the system root by default
GNUSTEP_INSTALLATION_DIR = $(GNUSTEP_SYSTEM_ROOT)
GNUSTEP_MAKEFILES = $(GNUSTEP_SYSTEM_ROOT)/Makefiles
include $(GNUSTEP_MAKEFILES)/common.make
include config.mak
GSWAPP_NAME=Hello
Hello_HAS_GSWCOMPONENTS=YES
Hello_PRINCIPAL_CLASS=Hello
Hello_GSWAPP_INFO_PLIST=Resources/Info-Hello.plist
# The Objective-C source files to be compiled
Hello_OBJC_FILES = Hello_main.m Hello.m HelloPage.m Main.m
Hello_COMPONENTS = Main.gswc HelloPage.gswc
SRCS = $(GSWAPP_NAME:=.m)
HDRS =
DIST_FILES = $(SRCS) $(HDRS) GNUmakefile Makefile.postamble Makefile.preamble
-include Makefile.preamble
include $(GNUSTEP_MAKEFILES)/gswapp.make
-include Makefile.postamble

3
Examples/hello/Hello.h Normal file
View file

@ -0,0 +1,3 @@
//====================================================================
@interface Hello : GSWApplication
@end

6
Examples/hello/Hello.m Normal file
View file

@ -0,0 +1,6 @@
#import <GSWeb/GSWeb.h>
#include "Hello.h"
@implementation Hello
@end

View file

@ -0,0 +1,16 @@
/*
* Hello.wod
*
* You may freely copy, distribute and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* This example was written with a Beta version of WebObjects.
*
* Written by WebObjects Development Team
*
* This is the declarations file for the second page (Hello) of the
* HelloWorldObjC application.
*/
BODY_NAME_STRING:GSWString {value = nameString}

View file

@ -0,0 +1,4 @@
{
encoding = NSISOLatin1StringEncoding;
variables = {};
}

View file

@ -0,0 +1,8 @@
<HTML>
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
Hello <GSWEB NAME=BODY_NAME_STRING></GSWEB>!
</BODY>
</HTML>

View file

@ -0,0 +1,22 @@
/*
* HelloPage.h
*
* You may freely copy, distribute and reuse the code in this example.
* Apple disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* This file declares the interface to the object that controls the Hello
* page.
*/
#import <GSWeb/GSWeb.h>
@interface HelloPage:GSWComponent
{
NSString *nameString;
}
- (void)setNameString:(NSString *)string;
@end

View file

@ -0,0 +1,27 @@
/*
* HelloPage.m
*
* You may freely copy, distribute and reuse the code in this example.
* Apple disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* This is the implementation file for the object that controls the Hello
* page.
*/
#import "HelloPage.h"
@implementation HelloPage
- (void)dealloc
{
DESTROY(nameString);
[super dealloc];
}
- (void)setNameString:(NSString *)string
{
ASSIGN(nameString,string);
}
@end

View file

@ -0,0 +1,10 @@
#import <GSWeb/GSWeb.h>
int main(int argc, const char *argv[])
{
int ret=0;
NSAutoreleasePool *arp = [NSAutoreleasePool new];
ret=GSWApplicationMain(@"Hello", argc, argv);
[arp release];
return ret;
}

23
Examples/hello/INSTALL Normal file
View file

@ -0,0 +1,23 @@
To install this little application:
o install GNUstep, GNUstepWeb (including apache module),..
o do a make install in this directory
o add entry for this application in your apache module configuration file:
hello = {
adaptorTemplatesPath = "/home/httpd/GSWAdaptorTemplates";
GSWExtensionsFrameworkWebServerResources="/GSW/GSWExtensions/WebServerResources";
canDump = YES;
instances = {
1 = {
host=YourHostName;
port=9001;
parameters= {
transport=socket;
};
};
};
};
o cd /usr/GNUstep/System/GSWApps/Hello.gswa
o run ./ix86/linux-gnu/gnu-gnu-gnu/Hello
o open your browser a goto: http://YourHostName/GSWeb/hello

View file

@ -0,0 +1,23 @@
/*
* Main.wod
*
* You may freely copy, distribute and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* Written by WebObjects Development Team
*
* This is the declarations file for the first page (Main) of the
* HelloWorldObjC application. Each declaration corresponds to a WEBOBJECT
* element in Main.html. The declarations specify a WODynamicElement to
* represent the corresponding WEBOBJECT element and configure the dynamic
* element with variables and methods defined in the Main object.
*
*/
NAME_FIELD:GSWTextField {value = nameString}
SUBMIT_BUTTON:GSWSubmitButton {action = sayHello}
MyForm: GSWForm {
}

View file

@ -0,0 +1,13 @@
<HTML>
<HEAD>
<TITLE>Hello World!</TITLE>
</HEAD>
<BODY>
<GSWEB NAME=MyForm>
What's your name?
<P>
<GSWEB NAME=NAME_FIELD><INPUT TYPE="text"></GSWEB>
<GSWEB NAME=SUBMIT_BUTTON><INPUT TYPE="SUBMIT"></GSWEB>
</GSWEB>
</BODY>
</HTML>

22
Examples/hello/Main.h Normal file
View file

@ -0,0 +1,22 @@
/*
* Main.h
*
* You may freely copy, distribute and reuse the code in this example.
* Apple disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* This file declares the interface to the object that controls the Main
* page.
*/
#import <GSWeb/GSWeb.h>
@interface Main:GSWComponent
{
NSString *nameString;
}
- (GSWComponent *)sayHello;
@end

54
Examples/hello/Main.m Normal file
View file

@ -0,0 +1,54 @@
/*
* Main.m
*
* You may freely copy, distribute and reuse the code in this example.
* Apple disclaims any warranty of any kind, expressed or implied, as to
* its fitness for any particular use.
*
* Written by WebObjects Development Team
*
* This is the implementation file for the object that controls the Main
* page.
*/
#import "Main.h"
#import "Hello.h"
#import "HelloPage.h"
@implementation Main
- (void)dealloc
{
DESTROY(nameString);
[super dealloc];
}
- (GSWComponent *)sayHello
{
HelloPage *nextPage= (HelloPage*)[self pageWithName:@"HelloPage"];
// Here we are using the EOKeyValueCodingProtocol to set 'nameString' in the Hello page
// The alternative would be to implement the accessor method 'setNameString:'
// [nextPage takeValue:nameString forKey:@"nameString"];
[nextPage setNameString:nameString];
return nextPage;
}
@end
@interface Session:GSWSession
{
}
@end
@interface Application:GSWApplication
{
}
@end
@implementation Session
@end
@implementation Application
@end

View file

@ -0,0 +1,71 @@
# Makefile.postamble
# Copyright (C) 1999 Free Software Foundation, Inc.
#
# Written by: Manuel Guesdon <mguesdon@sbuilders.com>
# Date: Jan 1999
#
# This file is part of the GNUstep Web Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Makefile.postamble
#
# Project specific makefile rules
#
# Uncomment the targets you want.
# The double colons (::) are important, do not make them single colons
# otherwise the normal makefile rules will not be performed.
#
# Things to do before compiling
# before-all::
# Things to do after compiling
# after-all::
# Things to do before installing
# before-install::
# Things to do after installing
# after-install::
# Things to do before uninstalling
# before-uninstall::
# Things to do after uninstalling
# after-uninstall::
# Things to do before cleaning
# before-clean::
# Things to do after cleaning
# after-clean::
# Things to do before distcleaning
# before-distclean::
# Things to do after distcleaning
# after-distclean::
# Things to do before checking
# before-check::
# Things to do after checking
# after-check::
regenerate:
copy-dist: $(DIST_FILES)

View file

@ -0,0 +1,72 @@
# Copyright (C) 1999 Free Software Foundation, Inc.
#
# Written by: Manuel Guesdon <mguesdon@sbuilders.com>
# Date: Jan 1999
#
# This file is part of the GNUstep Web Library.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Makefile.preamble
#
# Project specific makefile variables, and additional
#
# Do not put any Makefile rules in this file, instead they should
# be put into Makefile.postamble.
#
#
# Flags dealing with compiling and linking
#
# Additional flags to pass to the preprocessor
ADDITIONAL_CPPFLAGS =
# Additional flags to pass to the Objective-C compiler
ADDITIONAL_OBJCFLAGS =
# Additional flags to pass to the C compiler
ADDITIONAL_CFLAGS =
# Additional flags to pass to the Objective-C compiler
#new
ifeq ($(GDL2), yes)
ADDITIONAL_OBJCFLAGS = -DUSE_BUILTIN -DGDL2
else
ADDITIONAL_OBJCFLAGS = -DUSE_BUILTIN
endif
# Additional include directories the compiler should search
ADDITIONAL_INCLUDE_DIRS = -I$(GNUSTEP_SYSTEM_ROOT)/db -I../..
# Additional LDFLAGS to pass to the linker
ifeq ($(debug), yes)
ADDITIONAL_LDFLAGS = -lFoundationExt_d -lGSWeb -lGSANTLR_d -lgnustep-db2_d -lgnustep-db2control_d
else
ADDITIONAL_LDFLAGS = -lFoundationExt -lGSWeb -lGSANTLR -lgnustep-db2 -lgnustep-db2control
endif
#-lgnustep-xraw
# Additional library directories the linker should search
ADDITIONAL_LIB_DIRS =
#
# Flags dealing with installing and uninstalling
#
# Additional directories to be created during installation
ADDITIONAL_INSTALL_DIRS =

View file

@ -0,0 +1,14 @@
defaults = {
GSWAdaptor = GSWDefaultAdaptor;
GSWDebugSetConfigFilePath = "/etc/gsweb/Hello.logstate";
GSWHost = "localhost";
GSWPort = 9001;
GSWApplicationBaseURL = "/GSW";
GSWFrameworksBaseURL = "/GSW/frameworks";
GSWLoadFrameworks = (
"gsweb/GSWExtensionsGSW",
"gsweb/GSWExtensions"
);
GSWMonitorAppConfFilePath = "/etc/httpd/conf/GSWebMonitor.conf";
GSWSessionTimeOut = 1200;
};

View file

@ -0,0 +1,2 @@
DYNAMIC_LINKER=simple
#GDL2=yes