RE: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-20 Thread David Boyes

  $query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER];
  $query = sprintf($query, $parameter1, $parameter2);
 
 I'd vote for trying to do what Bacula does -- simplify the 
 SQL and not use any 
 non-standard MySQL SQL unless absolutely necessary.  Doing 
 that, we should be 
 able to keep the differences to only a few lines of SQL.  If 
 Bacula can do 
 it, then bacula-web can too (I think).  If we can accomplish 
 that then a few 
 lines of code as Juan Luis has shown are a good solution.

this approach would be very elegant for supporting additional databases
(eg, DB/2, Oracle, etc). 

-- db


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Juan Luis Frances
Hello Dan,

Please, commit your changes to the CVS when you want. However, perhaps you 
would want  to wait one commit in the next days with my last development 
version. I included a very (very) rudimentary support for PostgreSQL and I am 
convinced that you can adapt your patch to this version and surely update 
(better than I) the sql querys.

Next CVS Changelog:
- Updated French translation
- Initial support for PostgreSQL
- Upgrade Phplot to 5.0rc2 version.

Best regards,
Juan Luis Francs

El Viernes 17 Junio 2005 09:53, Kern Sibbald escribi:
 Hello Dan,

 Thanks for jumping into this :-)   For others on this list, bacula-web is
 written so it can be used by multiple DB engines.  However, if I am not
 mistaken, Juan Luis, doesn't have PostgreSQL loaded, and there are lots of
 tricky, totally non-evident things one must do to write DB neutral SQL
 (mostly due to the fact that MySQL prior to version 4.1 is not ANSI
 compatible).

 One question Dan:  Will your changes work equally well on MySQL?

 I'd like to hear from Juan Luis, but I think he would be pleased to see you
 commit your changes to the CVS (I know I would be happy -- with the
 exception perhaps of configs/bacula.conf)

 Best regards, Kern

 On Friday 17 June 2005 02:35, Dan Langille wrote:
  On 16 Jun 2005 at 20:03, Dan Langille wrote:
   On 17 Jun 2005 at 0:02, Kern Sibbald wrote:
Hello,
   
This is just to let you know that as was previously discussed on this
list, I have created a gui project in the Bacula Source Forge CVS
repository. At the moment, this project (or module) contains
bacula-web 1.1 written by Juan Luis Francs and bimagemgr written by
Scott Barninger.  Thanks to both of them for taking the time and
effort to write web based programs that add functionality to Bacula.
   
In case you have not heard about bacula-web, it is a web based
program that provides information on the status of your Bacula jobs
by reading the Catalog database. It includes a nice summary of what
happened in the last 24 hours and some nice graphics. bacula-web is
written in php, so needs a web server to run it.
   
bimagemgr is also a web based program, but it is written in Perl.
bimagemgr monitors Bacula disk Volumes that you intend to write to
CDROM.  For more information, please see the Bacula manual where it
is documented.
  
   I just downloaded this and got it going.  I like it.  Pretty easy to
   get running.  I especially like the test.php.  More PHP-based apps
   should do this type of checking.
  
   The only hitch on installing is that test.php did not detect my
   DB.php after I installed it.  On FreeBSD, this file goes to
   /usr/local/share/pear/DB.php.  A symlink solved that:
  
  ln -s /usr/local/share/pear/DB.php .
  
   When running the app, I got this error:
  
   [Thu Jun 16 19:10:33 2005] [error] PHP Notice:  Use of undefined
   constant hostspec - assumed 'hostspec' in
   /usr/websites/bacula.unixathome.org/classes.inc on line 44
  
   Putting the constants into quotes helped:
  
 $this-dsn['hostspec'] = $conf-get(CONFIG_FILE,DATABASE,host);
  
   Now I'll describe a problem which I've solved.  I'm documenting it so
   others know:
  
   The main page (index.php) is blank.  I'm finding that it's dying
   during this line:
  
  $dbSql = new Bweb();
  
   I looked closer, and it's dying during part of the constuctor:
  
  $this-link = $this-connect($this-dsn);
  
   I know this because I added a die() call right after the above.  It
   never gets executed.
  
   Dumping the variables, I get:
  
   dsn[hostspec]=localhost
   dsn[username]=bacula
   dsn[password]=
   dsn[database]=bacula
   dsn[phptype]=pgsql
  
   From bacula-dir.conf, in the Catalog resource, I have:
  
   dbname = bacula; user = bacula; password = 
  
   So I'm not sure why this is dying.
  
   Solution: Don't symlink.  Add something like this to php.ini:
  
   include_path = /usr/local/share/pear
  
   And remember to restart Apache.
  
   When looking at /external_packages/phplot/examples/test_setup.php, I
   noticed this:
  
   Use this form to test many different options of PHPlot. You can test
   every graph type supported for any of four different data types. You
   can tweak as you like or you can leave everything as is and press
   Submit for
  
   But I don't have a form... or a submit button.  I wonder if something
   is missed in the configuration.
  
   NOTE: from the /test.php page, everything looks good.  No problems.
  
   I had to create templates_c and chown it to www (which is what Apache
   runs as on my box).
  
   This I started getting these errors:
  
   Jun 16 19:50:52 polo postgres[38380]: [11-1] ERROR:  function
   unix_timestamp(timestamp without time zone) does not exist
  
   I'll work on converting the SQL to something that can work with
   PostgreSQL.
 
  I've converted the SQL.  The diffs are available here:
 

Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Kern Sibbald
Hello Juan Luis,

On Friday 17 June 2005 11:08, Juan Luis Frances wrote:
 Hello Dan,

 Please, commit your changes to the CVS when you want. However, perhaps you
 would want  to wait one commit in the next days with my last development
 version. I included a very (very) rudimentary support for PostgreSQL and I
 am convinced that you can adapt your patch to this version and surely
 update (better than I) the sql querys.

 Next CVS Changelog:
 - Updated French translation
 - Initial support for PostgreSQL
 - Upgrade Phplot to 5.0rc2 version.

So that we do not both do the same work, are you planning to make this commit, 
or are you expecting me to do it, which I will be glad to do?

Best regards, Kern


 Best regards,
 Juan Luis Francs

 El Viernes 17 Junio 2005 09:53, Kern Sibbald escribi:
  Hello Dan,
 
  Thanks for jumping into this :-)   For others on this list, bacula-web is
  written so it can be used by multiple DB engines.  However, if I am not
  mistaken, Juan Luis, doesn't have PostgreSQL loaded, and there are lots
  of tricky, totally non-evident things one must do to write DB neutral SQL
  (mostly due to the fact that MySQL prior to version 4.1 is not ANSI
  compatible).
 
  One question Dan:  Will your changes work equally well on MySQL?
 
  I'd like to hear from Juan Luis, but I think he would be pleased to see
  you commit your changes to the CVS (I know I would be happy -- with the
  exception perhaps of configs/bacula.conf)
 
  Best regards, Kern
 
  On Friday 17 June 2005 02:35, Dan Langille wrote:
   On 16 Jun 2005 at 20:03, Dan Langille wrote:
On 17 Jun 2005 at 0:02, Kern Sibbald wrote:
 Hello,

 This is just to let you know that as was previously discussed on
 this list, I have created a gui project in the Bacula Source
 Forge CVS repository. At the moment, this project (or module)
 contains bacula-web 1.1 written by Juan Luis Francs and bimagemgr
 written by Scott Barninger.  Thanks to both of them for taking the
 time and effort to write web based programs that add functionality
 to Bacula.

 In case you have not heard about bacula-web, it is a web based
 program that provides information on the status of your Bacula jobs
 by reading the Catalog database. It includes a nice summary of what
 happened in the last 24 hours and some nice graphics. bacula-web is
 written in php, so needs a web server to run it.

 bimagemgr is also a web based program, but it is written in Perl.
 bimagemgr monitors Bacula disk Volumes that you intend to write to
 CDROM.  For more information, please see the Bacula manual where it
 is documented.
   
I just downloaded this and got it going.  I like it.  Pretty easy to
get running.  I especially like the test.php.  More PHP-based apps
should do this type of checking.
   
The only hitch on installing is that test.php did not detect my
DB.php after I installed it.  On FreeBSD, this file goes to
/usr/local/share/pear/DB.php.  A symlink solved that:
   
   ln -s /usr/local/share/pear/DB.php .
   
When running the app, I got this error:
   
[Thu Jun 16 19:10:33 2005] [error] PHP Notice:  Use of undefined
constant hostspec - assumed 'hostspec' in
/usr/websites/bacula.unixathome.org/classes.inc on line 44
   
Putting the constants into quotes helped:
   
  $this-dsn['hostspec'] = $conf-get(CONFIG_FILE,DATABASE,host);
   
Now I'll describe a problem which I've solved.  I'm documenting it so
others know:
   
The main page (index.php) is blank.  I'm finding that it's dying
during this line:
   
   $dbSql = new Bweb();
   
I looked closer, and it's dying during part of the constuctor:
   
   $this-link = $this-connect($this-dsn);
   
I know this because I added a die() call right after the above.  It
never gets executed.
   
Dumping the variables, I get:
   
dsn[hostspec]=localhost
dsn[username]=bacula
dsn[password]=
dsn[database]=bacula
dsn[phptype]=pgsql
   
From bacula-dir.conf, in the Catalog resource, I have:
   
dbname = bacula; user = bacula; password = 
   
So I'm not sure why this is dying.
   
Solution: Don't symlink.  Add something like this to php.ini:
   
include_path = /usr/local/share/pear
   
And remember to restart Apache.
   
When looking at /external_packages/phplot/examples/test_setup.php, I
noticed this:
   
Use this form to test many different options of PHPlot. You can test
every graph type supported for any of four different data types. You
can tweak as you like or you can leave everything as is and press
Submit for
   
But I don't have a form... or a submit button.  I wonder if something
is missed in the configuration.
   
NOTE: from the /test.php page, everything looks good.  No problems.
   
I had to create templates_c and chown it to www (which is what Apache

Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Juan Luis Frances
Hello Kern,

I am expecting your commit. :-)

Best regards and thanks,
Juan Luis

El Viernes 17 Junio 2005 12:36, Kern Sibbald escribi:
 So that we do not both do the same work, are you planning to make this
 commit, or are you expecting me to do it, which I will be glad to do?




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77alloc_id492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Dan Langille
On 17 Jun 2005 at 11:08, Juan Luis Frances wrote:

 Hello Dan,
 
 Please, commit your changes to the CVS when you want. However, perhaps you 
 would want  to wait one commit in the next days with my last development 
 version. I included a very (very) rudimentary support for PostgreSQL and I am 
 convinced that you can adapt your patch to this version and surely update 
 (better than I) the sql querys.
 
 Next CVS Changelog:
 - Updated French translation
 - Initial support for PostgreSQL
 - Upgrade Phplot to 5.0rc2 version.

What form will the PostgreSQL support take?  Will there be different SQL for 
each supported database?  I ask because the PostgreSQL SQL will not work for 
MySQL.
-- 
Dan Langille : http://www.langille.org/
BSDCan - The Technical BSD Conference - http://www.bsdcan.org/




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Juan Luis Frances
Hello Dan,

 Will there be different SQL for each supported database?

Yes. One example: 

if ( $dbSql-driver == pgsql)
$query = ;

Best regards,
Juan Luis


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Stephan Holl
Hello Juan, 

On Fri, 17 Jun 2005 14:18:49 +0200 Juan Luis Frances
[EMAIL PROTECTED] wrote:

 Hello Dan,
 
  Will there be different SQL for each supported database?
 
 Yes. One example: 
 
 if ( $dbSql-driver == pgsql)
 $query = ;

What about using the PEAR:DB-package or something like adodb for
database abstraction? This would even easier to make the database-
interaction more transparent.

best
-- 
Stephan Holl

Check headers for GnuPG Key!
http://www.gdf-hannover.de



pgpHLxQpAGWVr.pgp
Description: PGP signature


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Dan Langille
On 17 Jun 2005 at 14:18, Juan Luis Frances wrote:

 Hello Dan,
 
  Will there be different SQL for each supported database?
 
 Yes. One example: 
 
 if ( $dbSql-driver == pgsql)
 $query = ;

OK, what about something like this.  Set up all your SQL in one 
place.

$queries[STUFF_FROM_TABLE1][POSTGRESQL] = 'select...';
$queries[STUFF_FROM_TABLE1][MYSQL] = 'select...';

Then, when you need a query, it's like this:

$query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER];

But, hat doesn't work very well if you have parameters

Hmmm, we could use a sprintf for parmeters.  For example:

$format = There are %d monkeys in the %s;
printf($format, $num, $location);

So the code becomes:

$query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER];
$query = sprintf($query, $parameter1, $parameter2);


-- 
Dan Langille : http://www.langille.org/
BSDCan - The Technical BSD Conference - http://www.bsdcan.org/




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Dan Langille
On 17 Jun 2005 at 14:27, Stephan Holl wrote:

 What about using the PEAR:DB-package or something like adodb for
 database abstraction? This would even easier to make the database-
 interaction more transparent.

It does use Pear::DB

The issue at hand is how different databases implement, or don't 
implement, the SQL standard.
-- 
Dan Langille : http://www.langille.org/
BSDCan - The Technical BSD Conference - http://www.bsdcan.org/




---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Juan Luis Frances
It seems a good idea, please give me time to think about it. I go to mountain 
this weekend (I am just shutting down the computer :-) ), when I come back I 
will respond you.

El Viernes 17 Junio 2005 14:28, Dan Langille escribi:
 On 17 Jun 2005 at 14:18, Juan Luis Frances wrote:
  Hello Dan,
 
   Will there be different SQL for each supported database?
 
  Yes. One example:
 
  if ( $dbSql-driver == pgsql)
  $query = ;

 OK, what about something like this.  Set up all your SQL in one
 place.

 $queries[STUFF_FROM_TABLE1][POSTGRESQL] = 'select...';
 $queries[STUFF_FROM_TABLE1][MYSQL] = 'select...';

 Then, when you need a query, it's like this:

 $query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER];

 But, hat doesn't work very well if you have parameters

 Hmmm, we could use a sprintf for parmeters.  For example:

 $format = There are %d monkeys in the %s;
 printf($format, $num, $location);

 So the code becomes:

 $query = $queries[STUFF_FROM_TABLE1][SELECTED_DRIVER];
 $query = sprintf($query, $parameter1, $parameter2);


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77alloc_id492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users


Re: [Bacula-users] Re: [Bacula-devel] GUI programs

2005-06-17 Thread Kern Sibbald
Hello Dan,

On Friday 17 June 2005 14:07, Dan Langille wrote:
 On 17 Jun 2005 at 11:08, Juan Luis Frances wrote:
  Hello Dan,
 
  Please, commit your changes to the CVS when you want. However, perhaps
  you would want  to wait one commit in the next days with my last
  development version. I included a very (very) rudimentary support for
  PostgreSQL and I am convinced that you can adapt your patch to this
  version and surely update (better than I) the sql querys.
 
  Next CVS Changelog:
  - Updated French translation
  - Initial support for PostgreSQL
  - Upgrade Phplot to 5.0rc2 version.

 What form will the PostgreSQL support take?  

I haven't looked at the code yet, so I cannot answer, but see below.

  Will there be different SQL  
 for each supported database?  I ask because the PostgreSQL SQL will not
 work for MySQL.

In Bacula, the SQL is identical except for a few very minor differences, so it 
is possible in *most* cases to use the same SQL, but it takes a lot of 
careful thinking and trials.

If you want, I can send you a tar of Juan Luis' latest code.  I am planning to 
integrate it (or start integrating it) this weekend.  I'm not at all familiar 
with php other than to know that it resembles C, so it may take me a bit ...

-- 
Best regards,

Kern

  (
  /\
  V_V


---
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477alloc_id=16492op=click
___
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users