CGI progamiing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

CGI progamiing

Theo Pronk
Hi,

I'm working on a Web project an would like to use Smalltalk.

Does anyone know how to or can anyone help me get started using
Smalltalk for CGI programs?

I believe console (command line) programs are probably the way to go.

I've done some work using Smalltalk applets but this has two major problem.

One: it is too difficult and time consuming to expect a casual user to
go to the trouble of loading the plugin.

Two: applets don't have the ability to store user input for later retrieval.

Thanks for any help.

Theo Pronk
email: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Andy Bower
Theo,

> I'm working on a Web project an would like to use Smalltalk.
>
> Does anyone know how to or can anyone help me get started using
> Smalltalk for CGI programs?
>
> I believe console (command line) programs are probably the way to go.

With Dolphin 4 Professional you can create console applications that are
suitable for CGI programs. The minimum executable size is about 350K
although this will probably be somewhat be larger depending on what
additional features such as ODBC, CDO etc your application makes use of.
Indeed, we are just about to start using a CGI program we've written
internally to log requests for trial Dolphin serial numbers. This app uses
ODBC and CDO (for sending e-mail) and is around 780K in size. It will be up
and running in the next few days. The only support class that we needed to
add was one called CGI which (at the moment) just parses the parameter
strings that are passed by HTTP.

Another possibility, which I find quite exciting is the idea of using Swazoo
(Smalltalk Web Application Zoo) for web server side programming. I know that
Swazoo has been ported to Dolphin... I'll go away and check the links.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---
























begin 666 CGI.cls
M(D9I;&5D(&]U="!F<F]M($1O;'!H:6X@4VUA;&QT86QK(#(P,# @<F5L96%S
M92 U+C P(B$-"@T*3V)J96-T('-U8F-L87-S.B C0T=)#0H):6YS=&%N8V56
M87)I86)L94YA;65S.B G<&%R86U3=')I;F<G#0H)8VQA<W-687)I86)L94YA
M;65S.B G)PT*"7!O;VQ$:6-T:6]N87)I97,Z("<G#0H)8VQA<W-);G-T86YC
M959A<FEA8FQE3F%M97,Z("<G(0T*0T=)(&-O;6U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79E<B(-"@T*"7!A<F%M4W1R:6YG
M(#H](&%3=')I;F<N(2 A#0HA0T=)(&-A=&5G;W)I97-&;W(Z("-P87)A;7,A
M86-C97-S:6YG(7!U8FQI8R$@(0T*(4-'22!C871E9V]R:65S1F]R.B C<&%R
M86U3=')I;F<A86-C97-S:6YG(7!R:79A=&4A("$-"B%#1TD@8V%T96=O<FEE
M<T9O<CH@(W!A<F%M4W1R:6YG.B%I;FET:6%L:7II;F<A<')I=F%T92$@(0T*
M#0HA0T=)(&-L87-S(&UE=&AO9'-&;W(A#0H-"G=I=&A087)A;5-T<FEN9SH@
M85-T<FEN9PT*"2)!;G-W97(@86X@:6YS=&%N8V4@;V8@=&AE(')E8V5I=F5R
M('-E="!U<"!T;R!U<V4@85-T<FEN9R!F;W(@=&AE('!A<W-E9"!P87)A;65T
M97)S(@T*#0H)7G-E;&8@;F5W('!A<F%M4W1R:6YG.B!A4W1R:6YG(2 A#0HA
M0T=)(&-L87-S(&-A=&5G;W)I97-&;W(Z("-W:71H4&%R86U3=')I;F<Z(6EN
=<W1A;F-E(&-R96%T:6]N(7!U8FQI8R$@(0T*#0H`
`
end


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Andy Bower
> With Dolphin 4 Professional you can create console applications that are
> suitable for CGI programs. The minimum executable size is about 350K
> although this will probably be somewhat be larger depending on what
> additional features such as ODBC, CDO etc your application makes use of.
> Indeed, we are just about to start using a CGI program we've written
> internally to log requests for trial Dolphin serial numbers. This app uses
> ODBC and CDO (for sending e-mail) and is around 780K in size. It will be
up
> and running in the next few days. The only support class that we needed to
> add was one called CGI which (at the moment) just parses the parameter
> strings that are passed by HTTP.

Just in case anyone is interested I've attached the text of the CGI class to
this message (if it gets through the news server I'm using).

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---
























begin 666 CGI.cls
M(D9I;&5D(&]U="!F<F]M($1O;'!H:6X@4VUA;&QT86QK(#(P,# @<F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M<&%R86U3=')I;F<@:7-.:6P@:694<G5E.B!;#0H)"7!A<F%M4W1R:6YG(#H]
M(%-E<W-I;VY-86YA9V5R(&-U<G)E;G0@<W1D:6X@8V]N=&5N=',@72X-"@E>
M<&%R86U3=')I;F<A#0H-"G!A<F%M4W1R:6YG.B!A4W1R:6YG#0H)(E!R:79A
M=&4@+2!);FET:6%L:7IE('1H92!R96-E:79E<B(-"@T*"7!A<F%M4W1R:6YG
M(#H](&%3=')I;F<N(2 A#0HA0T=)(&-A=&5G;W)I97-&;W(Z("-P87)A;7,A
M86-C97-S:6YG(7!U8FQI8R$@(0T*(4-'22!C871E9V]R:65S1F]R.B C<&%R
M86U3=')I;F<A86-C97-S:6YG(7!R:79A=&4A("$-"B%#1TD@8V%T96=O<FEE
M<T9O<CH@(W!A<F%M4W1R:6YG.B%I;FET:6%L:7II;F<A<')I=F%T92$@(0T*
M#0HA0T=)(&-L87-S(&UE=&AO9'-&;W(A#0H-"G=I=&A087)A;5-T<FEN9SH@
M85-T<FEN9PT*"2)!;G-W97(@86X@:6YS=&%N8V4@;V8@=&AE(')E8V5I=F5R
M('-E="!U<"!T;R!U<V4@85-T<FEN9R!F;W(@=&AE('!A<W-E9"!P87)A;65T
M97)S(@T*#0H)7G-E;&8@;F5W('!A<F%M4W1R:6YG.B!A4W1R:6YG(2 A#0HA
M0T=)(&-L87-S(&-A=&5G;W)I97-&;W(Z("-W:71H4&%R86U3=')I;F<Z(6EN
=<W1A;F-E(&-R96%T:6]N(7!U8FQI8R$@(0T*#0H`
`
end


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Jerry Bell
Andy,

Have you had any problem with permissions?

I've finally managed to get a Dolphin command-line CGI program running under
IIS.   I'm not using COM or anything fancy, just making some directories and
calling other executables.  The program would run great from the command
line, but would always fail when activated from IIS.  It looked like various
permissions problems.  I tried setting appropriate permissions, but I never
found the magic combination, I guess.  Earlier I had used a little COM with
even worse results.

I finally created a new, regular user and set the script directory to run
anonymous as that user (rather than the usual IUSR_whatever).  I don't think
that's very safe though- luckily there are no other programs other than the
Dolphin program in there, and I don't think I have to worry too much about
buffer overflows with that, right?

Anyway, I'm curious if you ran into this and/or was able to work around the
problem.  This is actually the first cgi-type program I've worked with so it
is very possible that I've done something wrong.

Thanks

Jerry Bell
[hidden email]


"Andy Bower" <[hidden email]> wrote in message
news:9iekc4$ib3k7$[hidden email]...
> > With Dolphin 4 Professional you can create console applications that are
> > suitable for CGI programs. The minimum executable size is about 350K
> > although this will probably be somewhat be larger depending on what
> > additional features such as ODBC, CDO etc your application makes use of.
> > Indeed, we are just about to start using a CGI program we've written
> > internally to log requests for trial Dolphin serial numbers. This app
uses
> > ODBC and CDO (for sending e-mail) and is around 780K in size. It will be
> up
> > and running in the next few days. The only support class that we needed
to
> > add was one called CGI which (at the moment) just parses the parameter
> > strings that are passed by HTTP.
>
> Just in case anyone is interested I've attached the text of the CGI class
to

> this message (if it gets through the news server I'm using).
>
> Best Regards,
>
> Andy Bower
> Dolphin Support
> http://www.object-arts.com
> ---
> Are you trying too hard?
> http://www.object-arts.com/Relax.htm
> ---
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Andy Bower
Jerry,

> Have you had any problem with permissions?
>
> I've finally managed to get a Dolphin command-line CGI program running
under
> IIS.   I'm not using COM or anything fancy, just making some directories
and
> calling other executables.  The program would run great from the command
> line, but would always fail when activated from IIS.  It looked like
various
> permissions problems.  I tried setting appropriate permissions, but I
never
> found the magic combination, I guess.  Earlier I had used a little COM
with
> even worse results.
>
> I finally created a new, regular user and set the script directory to run
> anonymous as that user (rather than the usual IUSR_whatever).  I don't
think
> that's very safe though- luckily there are no other programs other than
the
> Dolphin program in there, and I don't think I have to worry too much about
> buffer overflows with that, right?
>
> Anyway, I'm curious if you ran into this and/or was able to work around
the
> problem.  This is actually the first cgi-type program I've worked with so
it
> is very possible that I've done something wrong.

Problems with permissions? Well yes and no. First of all you have to tell
IIS that the directory where the EXE is has permissions to run "Script and
Executables". The next thing I did (although I'm now not convinced it was
necessary) was to go to the directory where the ODBC data was stored and
give the Internet Guest Account User the security rights to read and write
to this particular directory. This is all under Win2K.

One of the problems that you may be having is that any attempt by the CGI
program to bring up a GUI will cause the program to fail. I found that it
beeped and would leave the task running until IIS terminated it after a
couple of minutes timeout period. You must make sure that no message boxes
or windows get created.

Now I developed the CGI program in a fledgling Dolphin 4.5 which (amongst
other things) has much better separation between the packages (for example
there is now a Dolphin GUI base package). This allows the image stripper to
more fully remove unwanted stuff. I'm not sure whether this might have a
bearing on your problem since you are deploying under Dolphin 4 and perhaps
on occasion you ended up with some zombie windows remaining in your app
after stripping. These may have caused some unexpected failures in your app
as it tried to create some UI elements I suppose.

BTW, our app uses ODBC and COM in this CGI mode without any problems but, as
I said, I am using a different version of Dolphin underneath it all.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Bill Schwab-2
Andy,

> Now I developed the CGI program in a fledgling Dolphin 4.5 which (amongst
> other things) has much better separation between the packages (for example
> there is now a Dolphin GUI base package). This allows the image stripper
to
> more fully remove unwanted stuff. I'm not sure whether this might have a
> bearing on your problem since you are deploying under Dolphin 4 and
perhaps
> on occasion you ended up with some zombie windows remaining in your app
> after stripping. These may have caused some unexpected failures in your
app
> as it tried to create some UI elements I suppose.

Interesting.  Is this a known problem?  I have sometimes had problems with
deployed apps, though it was starting to look more like errors in copying
them across a network.  I hit one earlier today in fact, that gave me a
message about an end of stream (or something like that) while reading the
image.  Copying (I believe) the same file to the machine again fixed it.  I
should also mention that the machine in question was quite slow to start
running D4 apps.  I finally tried installing D4, and found that my usual
development image wouldn't load, but, the fresh install would load.  Then it
all suddenly started to work ~:0    If you think zombie views might be
involved, how would I prove or refute it?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Andy Bower
Bill,

> > Now I developed the CGI program in a fledgling Dolphin 4.5 which
(amongst
> > other things) has much better separation between the packages (for
example

> > there is now a Dolphin GUI base package). This allows the image stripper
> to
> > more fully remove unwanted stuff. I'm not sure whether this might have a
> > bearing on your problem since you are deploying under Dolphin 4 and
> perhaps
> > on occasion you ended up with some zombie windows remaining in your app
> > after stripping. These may have caused some unexpected failures in your
> app
> > as it tried to create some UI elements I suppose.
>
> Interesting.  Is this a known problem?  I have sometimes had problems with
> deployed apps, though it was starting to look more like errors in copying
> them across a network.  I hit one earlier today in fact, that gave me a
> message about an end of stream (or something like that) while reading the
> image.  Copying (I believe) the same file to the machine again fixed it.
I
> should also mention that the machine in question was quite slow to start
> running D4 apps.  I finally tried installing D4, and found that my usual
> development image wouldn't load, but, the fresh install would load.  Then
it
> all suddenly started to work ~:0    If you think zombie views might be
> involved, how would I prove or refute it?

It's only a known problem in so far as zombies are known problems. I
normally do a panic before any deployment to maxmise the chance of getting
rid of them so they won't turn up in the deployed EXE and bloat the size. I
was just pointing out that zombies, while not welcome in any executable, are
potentially more troublesome in a CGI program because it is effectively run
as a service and is not allowed to access the desktop.

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---


Reply | Threaded
Open this post in threaded view
|

Re: CGI progamiing

Andy Bower
In reply to this post by Andy Bower
Folks,

> BTW, our app uses ODBC and COM in this CGI mode without any problems but,
as
> I said, I am using a different version of Dolphin underneath it all.

The new trial registration system (announced in another thread) uses a
Dolphin CGI program to log user info, generate serial numbers and and e-mail
them out. Please try not to create too many unnecessary records in our
registration database as you try this out though!

Best Regards,

Andy Bower
Dolphin Support
http://www.object-arts.com
---
Are you trying too hard?
http://www.object-arts.com/Relax.htm
---