Re: [Gambas-user] Gambas server pages

2009-04-25 Thread Jesus Guardon
I'm trying to get server pages to work, but I can't.

My scripts doesn't work because gbw2 is not found in my system.
Executing the script in console gives:

je...@jesus:~$ ./test.gbs
/usr/bin/env: gbw2: No existe el fichero ó directorio
je...@jesus:~$

Using Ubuntu 8.10 - Gambas2 2.12 (Compiled without errors)

Any help is welcome.

Jesús

Steven James Drinnan escribió:
 I think I solved it. But some please tell me if I can do this better.
 
 After some more playing I decided to open up the copied files in gedit
 as a root user. When I changed the file and resaved it the program
 worked as expected. 
 
 
 Looks like a problem with Apache and cgi scripting and file ownership.
 
 Why the example worked OK I do not know.
 
 
 Steven

--
Crystal Reports #45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas server pages

2009-04-25 Thread Steven James Drinnan
Create a symbolic link like this

Code:
Open your terminal:

su

ln -s /usr/bin/gbs2 /usr/bin/gbw2



this will create the necessary file.

To test run your script through a terminal.

Then you just need to configure your web server to recognize gbw2
extensions. (Or just use cgi)





On Sat, 2009-04-25 at 17:59 +0200, Jesus Guardon wrote:
 I'm trying to get server pages to work, but I can't.
 
 My scripts doesn't work because gbw2 is not found in my system.
 Executing the script in console gives:
 
 je...@jesus:~$ ./test.gbs
 /usr/bin/env: gbw2: No existe el fichero ó directorio
 je...@jesus:~$
 
 Using Ubuntu 8.10 - Gambas2 2.12 (Compiled without errors)
 
 Any help is welcome.
 
 Jesús
 
 Steven James Drinnan escribió:
  I think I solved it. But some please tell me if I can do this better.
  
  After some more playing I decided to open up the copied files in gedit
  as a root user. When I changed the file and resaved it the program
  worked as expected. 
  
  
  Looks like a problem with Apache and cgi scripting and file ownership.
  
  Why the example worked OK I do not know.
  
  
  Steven
 
 --
 Crystal Reports #45; New Free Runtime and 30 Day Trial
 Check out the new simplified licensign option that enables unlimited
 royalty#45;free distribution of the report engine for externally facing 
 server and web deployment.
 http://p.sf.net/sfu/businessobjects
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user
 


--
Crystal Reports #45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas server pages

2009-04-24 Thread Steven James Drinnan
Well i do not know if you got the last message but I have been playing
with this. Got it working in Apache with cgi.

But i have this problem the example always works. yeah!

But when I try it myself with this program

#!/usr/bin/env gbw2
%
DIM myName AS String
%

!-- Variable declaration must come before any HTML --

html

h2My Test/h2

% 
myName = steven 
%

PMy name is %= myName %./P

/html

I test via the command line and get the right response. 

Content-type: text/html
Content-length: 123



!-- Variable declaration must come before any HTML --

html

h2My Test/h2



PMy name is steven./P

/html



But when I put on my webserver I get 

Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, ste...@localhost and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server error
log.



Apache/2.2.11 (Fedora) Server at localhost Port 80

in the appache error log i get

ERROR: #24: No startup method
[Fri Apr 24 16:31:20 2009] [error] [client 127.0.0.1] Premature end of
script headers: test4.gbw2

I have got SElinux disabled, I need to to get anything working but I
will sort that out later.

Any thoughts

Steven







--
Crystal Reports #45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas server pages

2009-04-24 Thread Steven James Drinnan
Well i do not know if you got the last message but I have been playing
with this. Got it working in Apache with cgi.


--
Crystal Reports #45; New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty#45;free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas Server Pages mysql

2009-04-23 Thread Dimitris Anogiatis
Thanks Benoit that works like a charm :)
Regards
Dimitris

2009/4/22 Benoît Minisini gam...@users.sourceforge.net

  Hey guys,
 
  With the example below Gambas Server Pages were introduced.
 
  My question is:
  1) how would I achieve a connection to a mysql database or any database
 for
  that matter?
  2) where in the code below would I put the necessary statements?
  3) if no direct reference to any database objects can be made is the
  alternative, by lets say, using an external gambas module or some other
  trick?
 
 
 --8---
 ---
 
  #!/usr/bin/env gbw2
  %
  DIM sEnv AS String
  %
 
  !-- Variable declaration must come before any HTML --
 
  html
 
  h2CGI script environmental variables/h2
 
  table border=1 cellspacing=0 cellpadding=2
 
tr
  th align=leftName/th
  th align=leftValue/th
/tr
 
  % FOR EACH sEnv IN Application.Env %
tr valign=top
  td%= sEnv %/td
  td%= Application.Env[sEnv] % /td
/tr
  % NEXT %
 
  /table
 
  /html
 
 --8---
 ---
 
  Thanks in advance
 
  Regards
  Dimitris

 You must add:

 %
 USE gb.db
 %

 at the beginning of the page, and then you can access any database.

 Regards,

 --
 Benoît


 --
 Stay on top of everything new and different, both inside and
 around Java (TM) technology - register by April 22, and save
 $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
 300 plus technical and hands-on sessions. Register today.
 Use priority code J9JMT32. http://p.sf.net/sfu/p
 ___
 Gambas-user mailing list
 Gambas-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/gambas-user

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas Server Pages mysql

2009-04-22 Thread Benoît Minisini
 Hey guys,

 With the example below Gambas Server Pages were introduced.

 My question is:
 1) how would I achieve a connection to a mysql database or any database for
 that matter?
 2) where in the code below would I put the necessary statements?
 3) if no direct reference to any database objects can be made is the
 alternative, by lets say, using an external gambas module or some other
 trick?

 --8---
---

 #!/usr/bin/env gbw2
 %
 DIM sEnv AS String
 %

 !-- Variable declaration must come before any HTML --

 html

 h2CGI script environmental variables/h2

 table border=1 cellspacing=0 cellpadding=2

   tr
 th align=leftName/th
 th align=leftValue/th
   /tr

 % FOR EACH sEnv IN Application.Env %
   tr valign=top
 td%= sEnv %/td
 td%= Application.Env[sEnv] % /td
   /tr
 % NEXT %

 /table

 /html
 --8---
---

 Thanks in advance

 Regards
 Dimitris

You must add:

% 
USE gb.db
%

at the beginning of the page, and then you can access any database.

Regards,

-- 
Benoît

--
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


[Gambas-user] Gambas server pages

2008-09-22 Thread Benoit Minisini
Hi,

In the last revision of the 2.0 branch, you will find some sort of gambas 
scripter hack that allows you to write ASP-like files that I named Gambas 
server pages.

Put that in a text file, make it executable, and run it. Do not forget to 
run make install in the app source directory to recompile and install the 
new scripter.

--8
#!/usr/bin/env gbw2
%
DIM sEnv AS String
%

!-- Variable declaration must come before any HTML --

html

h2CGI script environmental variables/h2

table border=1 cellspacing=0 cellpadding=2

  tr
th align=leftName/th
th align=leftValue/th
  /tr

% FOR EACH sEnv IN Application.Env %
  tr valign=top
td%= sEnv %/td
td%= Application.Env[sEnv] %nbsp;/td
  /tr
% NEXT %

/table

/html
--8

As you can see, the server page is a script, but the script executable 
is 'gbw2', not 'gbs2'. 

'gbw2' is actually a symbolic link to 'gbs2'. When 'gbs2' detects than it is 
run from the 'gbw2' symbolic link, it knows that it will have to process a 
server page and not a script. Then 'gbs2' will transform the server page 
into...a normal script, and will execute it.

Except the initial line with the '#!/usr/bin/env gbw2' magic, the syntax is 
very similar to ASP pages.

* % XXX % introduces any Gambas code.

* %= XXX % evaluates a Gambas expression, translates it into HTML, and 
inserts the HTML inline.

Note that the gb.web component is used by default. So you can use the Session 
object, the Response object, the Request object, and so on.

These Gambas server page are CGI scripts, and must be managed as any other CGI 
script in your preferred web server.

I hope I gave enough information so that you can test that quick  dirty 
hack. :-)

Regards,

-- 
Benoit Minisini

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas server pages

2008-09-22 Thread François
Le Monday 22 September 2008 15:06:05 Benoit Minisini, vous avez écrit :
 Hi,

 In the last revision of the 2.0 branch, you will find some sort of gambas
 scripter hack that allows you to write ASP-like files that I named Gambas
 server pages.

 Put that in a text file, make it executable, and run it. Do not forget to
 run make install in the app source directory to recompile and install the
 new scripter.

 --8
 #!/usr/bin/env gbw2
 %
 DIM sEnv AS String
 %

 !-- Variable declaration must come before any HTML --

 html

 h2CGI script environmental variables/h2

 table border=1 cellspacing=0 cellpadding=2

   tr
 th align=leftName/th
 th align=leftValue/th
   /tr

 % FOR EACH sEnv IN Application.Env %
   tr valign=top
 td%= sEnv %/td
 td%= Application.Env[sEnv] %nbsp;/td
   /tr
 % NEXT %

 /table

 /html
 --8

 As you can see, the server page is a script, but the script executable
 is 'gbw2', not 'gbs2'.

 'gbw2' is actually a symbolic link to 'gbs2'. When 'gbs2' detects than it
 is run from the 'gbw2' symbolic link, it knows that it will have to process
 a server page and not a script. Then 'gbs2' will transform the server page
 into...a normal script, and will execute it.

 Except the initial line with the '#!/usr/bin/env gbw2' magic, the syntax is
 very similar to ASP pages.

 * % XXX % introduces any Gambas code.

 * %= XXX % evaluates a Gambas expression, translates it into HTML, and
 inserts the HTML inline.

 Note that the gb.web component is used by default. So you can use the
 Session object, the Response object, the Request object, and so on.

 These Gambas server page are CGI scripts, and must be managed as any other
 CGI script in your preferred web server.

 I hope I gave enough information so that you can test that quick  dirty
 hack. :-)

 Regards,

Ho that's very excellent Benoit ! :)  Thank you.
This is another way to have dynamic pages by using GSP instead of PHP ! Really  
nice.

I'm testing this immediatly. (I hope my problem is resolved about the install 
issue in order to try.)

-- 
GarulfoUnix - François Gallo 
(fr)Contributeur à Gambas(Traductions, documentations, rapport de bugs...)
(en)Gambas contributor(Translation, documentation, bugs report...and so on)

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] Gambas server pages

2008-09-22 Thread ihayw...@iinet.net.au


On Mon Sep 22 18:59 , François [EMAIL PROTECTED] sent:

Le Monday 22 September 2008 15:06:05 Benoit Minisini, vous avez écrit :
 Hi,

 In the last revision of the 2.0 branch, you will find some sort of gambas
 scripter hack that allows you to write ASP-like files that I named Gambas
 server pages.

 Put that in a text file, make it executable, and run it. Do not forget to
 run make install in the app source directory to recompile and install the
 new scripter.
It would be useful have a similar system for in-line HTML: that
is, HTML generated within graphical clients for display within HTML widgets,

Ian Haywood

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user