You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(35) |
Nov
(38) |
Dec
(112) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(20) |
Feb
(24) |
Mar
(47) |
Apr
(18) |
May
(28) |
Jun
(17) |
Jul
(15) |
Aug
(40) |
Sep
(14) |
Oct
(5) |
Nov
(26) |
Dec
(31) |
| 2003 |
Jan
(8) |
Feb
(14) |
Mar
(38) |
Apr
(34) |
May
(33) |
Jun
(32) |
Jul
(24) |
Aug
(9) |
Sep
|
Oct
(20) |
Nov
(43) |
Dec
(22) |
| 2004 |
Jan
(23) |
Feb
(25) |
Mar
(15) |
Apr
(3) |
May
(31) |
Jun
(13) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(15) |
Nov
(3) |
Dec
(5) |
| 2005 |
Jan
|
Feb
|
Mar
(16) |
Apr
(24) |
May
|
Jun
(2) |
Jul
|
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(3) |
Dec
(2) |
| 2006 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Chris M. <Chr...@te...> - 2003-02-19 19:22:40
|
Hello, At present the vast majority of users visiting my site are not logged in. I noticed that my session table fills up very quickly. The site's been live since mid-January and my session table was huge - almost a gig - I can't tell exactly because it ate my disk space and corrupted the table. Any ideas about why this is happening? Is clearing the session table something that I'm supposed to do? Thanks, Chris McDaniel |
|
From: Chris W. <ch...@cw...> - 2003-02-10 12:48:26
|
Chris McDaniel wrote:
> This is not my first package, but it is my first 'real' on for OI 1.54 (with
> DB and whatnot). I have 2 subs in my handler pm, one called "handler" and
> one called "cancel". Even when I post my form to /PackageName/Cancel,
> "handler" still gets called, and not cancel. I don't really know why this
> is happening. I've compared it to other packages and it looks OK, and there
> is nothing terribly out of the ordinary in the logs.
It's actually doing what it's supposed to. If you define 'handler'
that's the only method that will get called by the top-level
dispatcher. By defining it you're telling OI that you'll handle
whatever dispatching is necessary.
In most cases you want OI to handle this for you. To have OI handle
the dispatching (plus security checking, default action calling,
etc.), make your action a subclass of
OpenInteract::Handler::GenericDispatcher. Then rename 'handler' to
something else (e.g., 'display') and define the package variable
'default_method' to tell the dispatcher what method to call when
none is defined. So:
package My::Action:
use base qw( OpenInteract::Handler::GenericDispatcher );
$My::Action::default_method = 'display';
sub display {
# ... this will get called by default ...
}
sub cancel {
# ... this will get called when the user specifies
# 'cancel' in the URL ...
}
> Also, a quick question - what is the display bit in the spops.perl for? I
> thought action.perl took care of the display stuff?
It does, but 'display' in spops.perl makes it easy to ask the object
how to display itself and have one place for the information as
opposed to embedding URLs all over the place. (It's still probably
too much coupling, but it's not bad for now.)
You can get his information with the SPOPS 'object_description' method:
my $info = $spops_object->object_description;
print "My display URL: $info->{url}\n"
My edit URL: $info->{url_edit}\n",
My name: $info->{name} $info->{title}\n";
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris M. <Chr...@te...> - 2003-02-10 05:41:46
|
Hello,
This is not my first package, but it is my first 'real' on for OI 1.54 (with
DB and whatnot). I have 2 subs in my handler pm, one called "handler" and
one called "cancel". Even when I post my form to /PackageName/Cancel,
"handler" still gets called, and not cancel. I don't really know why this
is happening. I've compared it to other packages and it looks OK, and there
is nothing terribly out of the ordinary in the logs. I'm not even sure what
files to quote, but for starters, here's my action.perl:
$data = {
'packagename' => {
'class' => 'commerce::Handler::PackageName',
'security' => 'no',
}
};
Also, a quick question - what is the display bit in the spops.perl for? I
thought action.perl took care of the display stuff?
Thanks,
Chris McDaniel
|
|
From: Chris W. <ch...@cw...> - 2003-01-23 13:18:32
|
Nick Tkachenko wrote: > I have some databases (db1, db2 etc). > Some packages should work with one databasebase, some - at once with > several. How to configure OI, to use this opportunity? > > Ok! I'll describe my databases in conf/override_spops.ini & > conf/server.ini as: > [db_info db1] > ... > [db_info db2] > ... > > But how it is necessary to configure package, that this databases is > used? And how it is possible to use two different bases in package? > Whether I (and whether it will be correct) can use designs of a > kind "db1.table1" in struct/table1.sql for example? The package should not care what database you are using. Just set the configuration in conf/override_spops.ini, where 'myobject' is the object you have defined in your package: [myobject.datasource] action = add value = db1 or [myotherobject.datasource] action = add value = db2 And I think everything should work for creating the schemas, inserting data and fetching data. By default objects will use the datasource defined in: [datasource] default_connection_db = main So you only need to create entries in conf/override_spops.ini for the objects that are different. > Sorry for my bad english :-( Your english is much better than my russian! (It's been 10 years since school...) Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Nick T. <ni...@fb...> - 2003-01-23 09:34:41
|
I have some databases (db1, db2 etc). Some packages should work with one databasebase, some - at once with several. How to configure OI, to use this opportunity? Chris wrote about it: CW> $WEBSITE_DIR/conf/override_spops.ini: CW> [user.datasource] CW> action = add CW> value = UserDatasource CW> $WEBSITE_DIR/conf/server.ini: CW> [db_info UserDatasource] CW> db_owner = CW> username = user CW> password = password CW> dsn = dbname=userdb CW> db_name = CW> driver_name = Pg CW> sql_install = CW> long_read_len = 65536 CW> long_trunc_ok = 0 Ok! I'll describe my databases in conf/override_spops.ini & conf/server.ini as: [db_info db1] ... [db_info db2] ... But how it is necessary to configure package, that this databases is used? And how it is possible to use two different bases in package? Whether I (and whether it will be correct) can use designs of a kind "db1.table1" in struct/table1.sql for example? Sorry for my bad english :-( -- Nikollos |
|
From: Chris W. <ch...@cw...> - 2003-01-15 22:11:07
|
Chris McDaniel wrote:
> Here's my question - If I want to run SSL and non SSL instances of the same
> site, I need to use 2 virtualhost blocks (AFAIK) so I've made a copy of my
> modperl solo conf file and changed it to reflect port 80 only, and I'm
> including them both in my httpd.conf - now when I start it up I know it's
> running startup.pl twice, but it seems to work OK, and when I login on one
> side (https, for example) I seem to carry my session over when I switch to
> the http side. Any downsides to this? it doesn't seem like a good idea to
> me but nothing else seems to work...
It always seemed to me that running an SSL-enabled mod_perl
backend is unnecessary if you have SSL-enabled lightweight apache
frontends. Plus SSL-enabling a mod_perl server is adding girth to
a process that's already pretty heavy to begin with.
The following should work without any problems:
SSL-encrypted traffic
|
--------- ------> --------------- ------> ----------
browser | lightweight-SSL proxy mod_perl
--------- <------ --------------- <------ ----------
| | | |
| +---Unencrypted traffic-+------|--|
| | | |
+--------------> ------------------- -----+ |
| | lightweight non-SSL proxy |
+<-------------- ------------------- <-------+
So the traffic between browser and SSL-enabled frontend server is
encrypted, but the traffic between frontend and backend isn't.
And since the non-SSL-enabled frontend server talks to the same
backend as the SSL-enabled frontend server you won't have any
replication issues or anything.
Of course, this means you need to run a frontend server with
mod_proxy compiled in. But this is a good idea anyway :-)
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris M. <Chr...@te...> - 2003-01-15 21:45:44
|
Hello, Here's my question - If I want to run SSL and non SSL instances of the same site, I need to use 2 virtualhost blocks (AFAIK) so I've made a copy of my modperl solo conf file and changed it to reflect port 80 only, and I'm including them both in my httpd.conf - now when I start it up I know it's running startup.pl twice, but it seems to work OK, and when I login on one side (https, for example) I seem to carry my session over when I switch to the http side. Any downsides to this? it doesn't seem like a good idea to me but nothing else seems to work... Thanks, Chris McDaniel |
|
From: Chris W. <ch...@cw...> - 2003-01-13 15:51:48
|
Nick Sutterer wrote:
> hi all!
>
> i'm thinking of providing a "plug-in" mechanism so that programmers can
> extend an existing SPOPS object with additional properties and even new
> functionality (methods).
>
> i use the setup found in the SPOPS/eg dir which is of course chris' idea:
> - have one class per object
> - the class has at least two methods which are
> - _base_config(): returns the SPOPS config hash
> - config_class(): calls SPOPS::Initialize->process() with the config hash
> from _base_config()
>
> my idea is to write a new sub-class of the respective object. the
> constructor of the new object will call the "_base_config" method from its
> parent and extend the returned array as necessary, eg with more "has_a"
> fields.
>
> there are a few problems with this technique:
> if an object has "has_a" properties (which are again classes), the
> config_class() methods of these classes have to be called *before* the
> respective class calls SPOPS::Initialize->process(), because the "has_a"
> classes must be "known" by the SPOPS subsystem (which means, they must
> have been created by SPOPS before).
Fortunately there's a way to do this in SPOPS using
SPOPS::ClassFactory behaviors.
To start with: every SPOPS class goes through a runtime code
generation process that looks like this:
1 2 3
configuration --> Process configuration --> SPOPS class
ClassFactory behaviors allow you to declare steps between 2 and 3
to either modify the configuration before it's processed or to
generate code to go into the generated class.
I'm not sure where you're getting 'has_a' information from, but
what you'd want to do is something like this (untested):
package My::SPOPS::Rules;
use strict;
use SPOPS qw( _w DEBUG );
use SPOPS::ClassFactory qw( OK ERROR DONE );
sub behavior_factory {
my ( $class ) = @_;
return { manipulate_configuration => \&insert_hasa_config };
}
sub insert_hasa_config {
my ( $class ) = @_;
my $CONFIG = $class->CONFIG;
my %hasa_info = get_hasa_information_from_somewhere( ... );
while ( my ( $hasa_class, $hasa_conf ) = each %hasa_info ) {
$CONFIG->{has_a}{ $hasa_class } = $hasa_conf;
}
return ( OK, undef );
}
1;
(where 'get_hasa_information_from_somewhere(...)' is defined by you.)
You'd use this by adding 'My::SPOPS::Rules' to the 'rules_from'
key of your class configuration:
my %config = (
foo => {
class => 'My::Foo',
rules_from => [ 'My::SPOPS::Rules' ],
...
);
You can also generate the methods for 'has_a' if you'd like, but
this is a bit more involved.
For more information, see SPOPS::Manual::CodeGeneration,
SPOPS::ClassFactory and SPOPS::ClassFactory::DefaultBehavior.
Good luck!
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Nick S. <ni...@te...> - 2003-01-13 09:14:18
|
hi all! i'm thinking of providing a "plug-in" mechanism so that programmers can extend an existing SPOPS object with additional properties and even new functionality (methods). i use the setup found in the SPOPS/eg dir which is of course chris' idea: - have one class per object - the class has at least two methods which are - _base_config(): returns the SPOPS config hash - config_class(): calls SPOPS::Initialize->process() with the config hash from _base_config() my idea is to write a new sub-class of the respective object. the constructor of the new object will call the "_base_config" method from its parent and extend the returned array as necessary, eg with more "has_a" fields. there are a few problems with this technique: if an object has "has_a" properties (which are again classes), the config_class() methods of these classes have to be called *before* the respective class calls SPOPS::Initialize->process(), because the "has_a" classes must be "known" by the SPOPS subsystem (which means, they must have been created by SPOPS before). one solution is of course calling the config_class() method of all "has_a" classes *in* the SPOPS::Initialize->process() call of the respective class. this is the way chris goes in the example code. this may result in multiple config_class() calls of a single class. has anyone another solution for this? what do you think about this "inheritance" technique? is this text understandable at all? cheers, nick __________________________________________ nick sutterer cb&h productions ni...@te... the computer helps us solving problems which we wouldn't have without it. |
|
From: Chris W. <ch...@cw...> - 2003-01-10 14:41:00
|
Chris McDaniel wrote: > After installing a new package and fixing a few bugs in it, I get - > > Cannot find configuration object from stash class (commerce::Stash). Cannot > continue! at /var/www/localperl/lib/site_perl/5.6.1/OpenInteract.pm line 91. > > on the website, but nothing in the logs. This is OI-1.54 - Anyone know what > I did wrong? IIRC this means the stash wasn't created properly, which means something's borked in the startup procedure. Your server (not vhost) error logs should provide illumination. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris M. <Chr...@te...> - 2003-01-10 14:38:11
|
After installing a new package and fixing a few bugs in it, I get - Cannot find configuration object from stash class (commerce::Stash). Cannot continue! at /var/www/localperl/lib/site_perl/5.6.1/OpenInteract.pm line 91. on the website, but nothing in the logs. This is OI-1.54 - Anyone know what I did wrong? Thanks, Chris McDaniel |
|
From: Chris M. <Chr...@te...> - 2002-12-24 16:40:43
|
This works great - thanks! -----Original Message----- From: Chris Winters [mailto:ch...@cw...] Sent: December 20, 2002 6:58 AM To: Chris McDaniel Cc: 'ope...@li...' Subject: Re: [Openinteract-help] different template for basic pages? Chris McDaniel wrote: > I'm probably missing something obvious here, but I'm wondering about how to > make OI use a different template for basic pages pulled from the filesystem > than for pages generated from templates on a systemwide level. There's nothing basic you can do so you didn't miss anything. But you might try the following: - Each page has a 'main_template' property you can set for a particular template. To have them all use it by default, I'd do a SQL update (update page set main_template = 'foo'). - Issue an ALTER TABLE on page so that every new record has 'foo' for a default of main_template - Add 'main_template' to 'skip_undef' in the SPOPS configuration. This will tell SPOPS not to include 'main_template' in the insert if nothing is defined for it, and the default will be filled in properly. Rather than editing the SPOPS configuration directly, you can do the latter in $WEBSITE_DIR/conf/override_spops.ini as: [page.skip_undef] action = add value = main_template Then when you install a new version of base_page (a new one is coming in 1.55) your configuration won't be overwritten. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris W. <ch...@cw...> - 2002-12-24 16:01:11
|
Stanislav Sinyagin wrote: > Of course it's important to manage backups. > But the more critical issue is that the file appeared to be broken > after some unsuccessful apply_package commands. Absolutely. I'm still not sure how this happens but will try to devote some time in the near future to looking at it. I put a note on the wiki about it at: http://openinteract.sourceforge.net/cgi-bin/wiki.pl?OpenInteractIdeas Happy holidays! Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Stanislav S. <ssi...@ya...> - 2002-12-24 15:54:10
|
--- Chris Winters <ch...@cw...> wrote: > Yeah, oi_manage makes a backup but it's a pretty dumb backup. > It's overwritten with every command that modifies the repository > rather than saving a *good* copy and never overwriting it. I'll > make a note to fix this. Of course it's important to manage backups. But the more critical issue is that the file appeared to be broken after some unsuccessful apply_package commands. |
|
From: Chris W. <ch...@cw...> - 2002-12-24 15:04:01
|
Stanislav Sinyagin wrote: > --- And...@Be... wrote: > >>Hi Stanislav, >> >>you also could look for a backup copy of the repository file. Usually, >>oi_manage builds a backup copy, before it does the modifications. > > I forgot to mention that the backup copy was also broken. > It contained approx. the same contents as the main file. Yeah, oi_manage makes a backup but it's a pretty dumb backup. It's overwritten with every command that modifies the repository rather than saving a *good* copy and never overwriting it. I'll make a note to fix this. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Stanislav S. <ssi...@ya...> - 2002-12-24 10:29:33
|
I forgot to mention that I'm not looking for workaround advises. This was rather a bug report. Happy Holidays, Stanislav --- Stanislav Sinyagin <ssi...@ya...> wrote: > Hi all, > > I've made several unsuccessful tries to apply new packages (classified and news), > and now my conf/package_repository.perl is broken. |
|
From: Stanislav S. <ssi...@ya...> - 2002-12-24 10:24:12
|
--- And...@Be... wrote: > Hi Stanislav, > > you also could look for a backup copy of the repository file. Usually, > oi_manage builds a backup copy, before it does the modifications. I forgot to mention that the backup copy was also broken. It contained approx. the same contents as the main file. |
|
From: <And...@Be...> - 2002-12-24 07:42:19
|
Hi Stanislav, you also could look for a backup copy of the repository file. Usually, oi_manage builds a backup copy, before it does the modifications. later, Andreas -----Urspr=FCngliche Nachricht----- Von: Stanislav Sinyagin [mailto:ssi...@ya...] Gesendet am: Montag, 23. Dezember 2002 21:39 An: ope...@li... Betreff: Re: [Openinteract-help] RE: Mailman results for openinteract-help --- "Arva, Adrian" <ar...@cs...> wrote: > Hi, > You just have to delete the entry for the package that you tryied to apply. > hand editing the file is an error prone step but other than that is = not > complicated If this is the reply to my message about broken conf/package_repository.perl,=20 the thing is that before this file contained information about=20 all base packages, and now it doesn't. And when I start Apache,=20 I get only News.pm inside tmplib, and no other modules at all. So, the only way that I see is re-install the website, and do backups = before every big change. Regards,=20 Stan ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ openinteract-help mailing list ope...@li... https://lists.sourceforge.net/lists/listinfo/openinteract-help |
|
From: Stanislav S. <ssi...@ya...> - 2002-12-23 20:39:17
|
--- "Arva, Adrian" <ar...@cs...> wrote: > Hi, > You just have to delete the entry for the package that you tryied to apply. > hand editing the file is an error prone step but other than that is not > complicated If this is the reply to my message about broken conf/package_repository.perl, the thing is that before this file contained information about all base packages, and now it doesn't. And when I start Apache, I get only News.pm inside tmplib, and no other modules at all. So, the only way that I see is re-install the website, and do backups before every big change. Regards, Stan |
|
From: Arva, A. <ar...@cs...> - 2002-12-23 20:24:49
|
Hi, You just have to delete the entry for the package that you tryied to apply. hand editing the file is an error prone step but other than that is not complicated regards, Adrian |
|
From: Stanislav S. <ssi...@ya...> - 2002-12-23 16:58:12
|
Hi all,
I've made several unsuccessful tries to apply new packages (classified and news),
and now my conf/package_repository.perl is broken.
The sequence is as follows ( no OI-specific environment set):
oi_manage apply_package --package=classified-1.36 \
--website_dir=/v1/openinteract/oi.xicom.ch
oi_manage apply_package --package=classified-1.36 \
--website_dir=/v1/openinteract/oi.xicom.ch
these failed because base_dir appeared to be needed,
though there's not a word about it in the docs!
oi_manage apply_package --package=classified-1.36 \
--website_dir=/v1/openinteract/oi.xicom.ch \
--base_dir=/v1/openinteract/base
oi_manage apply_package --package=news-1.48 \
--website_dir=/v1/openinteract/oi.xicom.ch \
--base_dir=/v1/openinteract/base
these failed because version is not needed in --package
(again, examples needed, and would be nice to have better
handling in oi_manage)
oi_manage apply_package --package=news \
--website_dir=/v1/openinteract/oi.xicom.ch \
--base_dir=/v1/openinteract/base
Finally, this finished with success, but my
site's conf/package_repository.perl contains only one object
(see below).
After Holidays I'll try to fight it again...
Regards,
Stanislav.
===========================================================
$data = {
'META_INF' => {
'base_dir' => '/v1/openinteract/oi.xicom.ch'
},
'news-1.48' => {
'description' => 'Implement a simple news system.',
'installed_on' => '2002-12-23 17:43:57',
'package_dir' => 'pkg/news-1.48',
'base_dir' => '/v1/openinteract/base',
'name' => 'news',
'website_name' => 'XicomIntranet',
'website_dir' => '/v1/openinteract/oi.xicom.ch',
'url' => 'http://www.openinteract.org/',
'author' => [
'Chris Winters (ch...@cw...)'
],
'sql_installer' => 'OpenInteract::SQLInstall::News',
'version' => '1.48'
}
};
|
|
From: Chris W. <ch...@cw...> - 2002-12-20 11:50:39
|
Chris McDaniel wrote: > I'm probably missing something obvious here, but I'm wondering about how to > make OI use a different template for basic pages pulled from the filesystem > than for pages generated from templates on a systemwide level. There's nothing basic you can do so you didn't miss anything. But you might try the following: - Each page has a 'main_template' property you can set for a particular template. To have them all use it by default, I'd do a SQL update (update page set main_template = 'foo'). - Issue an ALTER TABLE on page so that every new record has 'foo' for a default of main_template - Add 'main_template' to 'skip_undef' in the SPOPS configuration. This will tell SPOPS not to include 'main_template' in the insert if nothing is defined for it, and the default will be filled in properly. Rather than editing the SPOPS configuration directly, you can do the latter in $WEBSITE_DIR/conf/override_spops.ini as: [page.skip_undef] action = add value = main_template Then when you install a new version of base_page (a new one is coming in 1.55) your configuration won't be overwritten. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris M. <Chr...@te...> - 2002-12-20 07:10:17
|
Hello, I'm probably missing something obvious here, but I'm wondering about how to make OI use a different template for basic pages pulled from the filesystem than for pages generated from templates on a systemwide level. Any hints? Thanks, Chris McDaniel |
|
From: Chris W. <ch...@cw...> - 2002-12-18 23:33:48
|
Chris McDaniel wrote: > You rock Chris - it's boggling sometimes how helpful you are... Uh oh, hold the phone. It seems according to this: http://www.perlmonks.org/index.pl?node_id=220919 (scroll down to mpeppler's response) that DBD::Sybase + FreeTDS doesn't do placeholders yet. (This is also in the docs and I missed it.) This is a problem -- placeholders are used all over the place in OI/SPOPS. Maybe the FreeTDS ODBC driver will be useful... Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris M. <Chr...@te...> - 2002-12-18 21:48:43
|
You rock Chris - it's boggling sometimes how helpful you are...
-----Original Message-----
From: Chris Winters [mailto:ch...@cw...]
Sent: December 18, 2002 4:05 PM
To: Chris McDaniel
Cc: ope...@li...
Subject: Re: [Openinteract-help] RE: proxying to mssql server
Chris McDaniel wrote:
> Thanks again - much appreciated! I will look into the JDBC option further
-
> trust perl to have everything!
Just for kicks (and I work with MS SQL a lot) I decided to see
how FreeTDS worked. FYI, I compiled this on Linux and am
connecting to a MS SQL 2000 server:
* Grab the latest CVS sources from FreeTDS (this fixes a
problem when using DBD::Sybase)
* Install FreeTDS with:
./configure --with-tdsver=7.0 --with-ssl \
--prefix=/usr/local/freetds
make
make install
* Download the latest DBD::Sybase (0.95)
* Edit DBD-Sybase-0.95/CONFIG with:
EXTRA_LIBS= -ltds -linsck
(I think for Solaris you need -ltds -ltli)
* set SYBASE=/usr/local/freetds (or whatever the configure
prefix is)
* perl Makefile.PL, make, make install
Now you need to edit /usr/local/freetds/etc/freetds.conf with
your server entry. (They have examples, it's pretty simple.) The
entry name is what you use as the server name in your DBI DSN:
freetds.conf:
[foo]
host=my.server.com
port=1433
DBI connection:
DBI->connect( 'DBI:Sybase:server=foo', ... )
All that works great. But the name/type information doesn't seem
to be retrieved in the same manner ($sth->{NAME}, $sth->{TYPE})
so SPOPS won't work without a little massaging. Namely, you need
to tell SPOPS what the field names and types are. Here's an example:
#!/usr/bin/perl
use strict;
use SPOPS::Initialize;
{
my %config = (
doodad => {
class => 'My::Doodad',
isa => [ 'SPOPS::DBI::Sybase', 'SPOPS::DBI' ],
rules_from => [ 'SPOPS::Tool::DBI::Datasource' ],
field => [ 'doodad_id', 'name', 'action' ],
id_field => 'doodad_id',
increment_field => 'yes',
no_insert => [ 'doodad_id' ],
no_update => [ 'doodad_id' ],
base_table => 'cw_doodad',
dbi_type_info => { doodad_id => 'int',
name => 'char',
action => 'char' },
dbi_config => { dsn =>
'DBI:Sybase:server=foo;database=foo',
username => 'foo',
password => 'foo' },
},
);
SPOPS::Initialize->process({ config => \%config });
My::Doodad->new({ doodad_id => 1,
name => 'foo',
action => 'run' })->save();
My::Doodad->new({ doodad_id => 2,
name => 'bar',
action => 'crawl' })->save();
my $doodads = My::Doodad->fetch_group();
foreach my $doodad ( @{ $doodads } ) {
print Dumper( $doodad );
}
}
The 'dbi_type_info' field is where we need to specify the
name/type mapping since we cannot discover it automatically (yet).
So it would *seem* to work. I haven't tried a full OI install
with this but I'm pretty sure the only sticky point would be
SPOPS, which should be ok with the workaround posted above.
I see that DBD::Sybase supports the DBI column_info method for
retrieving column metadata. I haven't listened in on the DBI
mailing list for a while so I don't know if this is replacing
{NAME}/{TYPE} or what. If so I'll build support into SPOPS.
Have fun!
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|