[OGo-Developer] noob question on building sope-appserver/samples/HelloForm

Helge Hess developer@opengroupware.org
Sat, 18 Nov 2006 10:13:43 +0100


On Nov 18, 2006, at 07:22, Chad Leigh wrote:
> I downloaded a fresh version (4.5.9), unpacked it

Best thing to do is to retrieve it from Svn:

   svn co http://svn.opengroupware.org/SOPE/trunk/

This way you get the latest fixes (eg the Xcode fixes done by ZNeK).

> One quick question.  I know  a readme says I should always go  
> through apache and the adapter, but for testing I am direct  
> connecting on my Mac as I don't have apache set up.

Well, Apache is pre-setup on every MacOS client machine. Just build  
sope-appserver/mod_ngobjweb (I think typing 'make' should be  
sufficient), and copy the 'mod_ngobjweb.so' to /usr/libexec/httpd/.

Then add
---snip---
LoadModule ngobjweb_module /usr/libexec/httpd/mod_ngobjweb.so
<LocationMatch "^/Test*">
SetHandler ngobjweb-adaptor
SetAppPort 20000
</LocationMatch>
---snap---

to your /etc/httpd/httpd.conf and run 'apachectl restart'.

You should really use Apache as a frontend, otherwise its calling for  
trouble because SOPE itself is not really a full HTTP implementation  
and doesn't properly deal with keepalives and such (from a HTTP  
clients perspective).

> I am running HelloForm sample and I run it at the commandline so
>
> % ./HelloForm
>
> It says it is listening on port 20000 so I do http://localhost:20000
>
> and up comes a form with an input box and an OK button.

The URL is wrong, you must at least add an application name, eg:
   http://localhost:20000/Test

> I type in something and hit ok.    It appears by looking in the  
> Main.m file for the Main.wo component that  it should print
>
> duration:  x.nnn
>
> in my browser as part of the appendToResponse call

Why should that appear in the browser? Its just a printf which prints  
on stdout. If you want to put that in the browser, use:
   [_r appendContentHTMLString:
     [NSString stringWithFormat:@"duration %.3f\n", ...]];

But of course you usually wouldn't do it that way in WO. Instead you  
would use a WOString and bind it to some method.

> But that is going to my shell instead.  Is that right or am I doing  
> something wrong?

No, its right. 'printf' always prints on stdout ;-)

> here is sample output

Looks OK. (except for the initial URL which must be /App or something).

Greets,
   Helge
-- 
Helge Hess
http://docs.opengroupware.org/Members/helge/