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 W. <ch...@cw...> - 2002-09-24 14:45:48
|
On Tue, 2002-09-24 at 06:55, Eric Veldhuyzen wrote:
> I am a starter with SPOPS and I have a little problem with the links_to
> option.
>
> I have two tables, object and subobject. subobject has two
> foreign keys, so that's two 'has_a' fields. Now I would like to give the
> object table two links_to fields, but I can't figure out how to do
> this.
This is a little complicated for the existing auto-generation scheme.
I'd just go ahead and code it, adding the code in the 'code_class'
configuration option. For example:
'object' => {
class => 'My::object',
isa => [ qw{ My::base } ],
>>>>> code_class => [ 'My::ObjectImpl' ], <<<<<
...
}
Then create the code:
----------------------------------------
package My::ObjectImpl;
use strict;
sub my_subobjects_parent {
my ( $self ) = @_;
return My::subobject->fetch_group({
where => 'object_id_parent = ?',
value => [ $self->id ] })
}
sub my_subobjects_child {
my ( $self ) = @_;
return My::subobject->fetch_group({
where => 'object_id_child = ?',
value => [ $self->id ] })
}
1;
----------------------------------------
Hope this helps.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Eric V. <er...@te...> - 2002-09-24 10:55:32
|
Hi,
I am a starter with SPOPS and I have a little problem with the links_to
option.
I have two tables, object and subobject. subobject has two
foreign keys, so that's two 'has_a' fields. Now I would like to give the
object table two links_to fields, but I can't figure out how to do
this.
This is wat I have right now:
'object' => {
class => 'My::object',
isa => [ qw{ My::base } ],
field => [ qw{
id
name
physical_object
}
],
strict_field => 'yes',
id_field => [ qw{ id } ],
no_insert => [ qw{ id } ],
no_update => [ qw{ id } ],
base_table => 'object',
increment_field => 1,
sequence_name => 'shared_ids',
}
'subobject' => {
class => 'My::subobject',
isa => [ qw{ My::base } ],
field => [ qw{
id
name
object_id_parent
object_id_child
}
],
strict_field => 'yes',
id_field => [ qw{ id } ],
no_insert => [ qw{ id } ],
no_update => [ qw{ id } ],
default_values => {
},
has_a => {
'My::object' => 'object_id_parent',
'My::object' => 'object_id_child',
base_table => 'subobject',
increment_field => 1,
sequence_name => 'shared_ids',
}
What should I add to the object definition to get these links_to
working?
--
#!perl # Life ain't fair, but root passwords help.
# Eric Veldhuyzen http://terra.nu/
$!=$;=$_+(++$_);($:,$~,$/,$^,$*,$@)=$!=~ # er...@te...
/.(.)...(.)(.)....(.)..(.)..(.)/;`$^$~$/$: $^$*$@$~ $_>&$;` #Perl Monger
|
|
From: Eric R. <er...@1s...> - 2002-09-13 22:01:13
|
Chris Winters <ch...@cw...> said: > > I see the line in question (when the \'field\' value of an SPOPS > configuration is undefined), but this should have been defined earlier > in the process.... Just for kicks, do something like: > > # cd $WEBSITE_DIR/pkg > # find . -name \"spops.perl\" | xargs grep \' field \' > > And see if you have any items with one of: > > field => \'\' > field => undef, > > If so, try changing them to: > > field => [], > > And see what happens. Clearly this is fragile and shouldn\'t be so. > Hah. I had an SPOPS object defined without a \'field\' value in my package\'s spops.perl. I had mistakenly only defined a \'field_order\', and since I haven\'t yet used this object, I didn\'t see the error until now. It\'s always something simple. For some reason, the migrate script still doesn\'t like me. Here\'s what we\'ve got now: -- Using (/home/1stcontact.com/intranet) for \'website_dir\'. Can\'t locate object method \"process\" via package \"SPOPS::Initialize\" (perhaps you forgot to load \"SPOPS::Initialize\"?) at script/migrate_to_filesystem.pl line 30. -- It has been a week since I\'ve had any time to tackle this one, so I\'m probably overlooking something else. Another push in the right direction would of course be greatly appreciated. Thanks again. Eric |
|
From: Chris W. <ch...@cw...> - 2002-09-11 11:18:59
|
On Mon, 2002-09-09 at 19:31, Chris McDaniel wrote:
>
> Hi,
>
> Yes, I've actually tried that... and the eq as opposed to == thing - I
> wasn't thinking when I wrote that in the email I guess ;-)
>
> Anyway, here's what I've got right now... it's a bit of a mishmash of
> different things I've tried. The input is from a form that displays a
> number of records. When a record is changed, it sets a 'dirty' variable
> (with javascript, a hidden field) so that I can tell which ones have
> changed. $count comes from the form to indicate how many records have been
> displayed. And, of course, the delete parameter is from a checkbox...
Nothing immediately jumps out at me, so here's a shot at simplifying:
for my $i ( 0 .. $count ) {
my $dirty_field = "dirty$i";
my $delete_field = "delete$i";
...
my $is_dirty = $apr->param( $dirty_field );
if ( $is_dirty ) {
$R->scrib( 0, "Field [$i] is dirty" );
my $delete_status = $apr->param( $delete_field ) || 'off';
$R->scrib( 0, "Delete status of field [$i]: $delete_status" );
if ( $delete_status eq 'on' ) [
...
}
else {
...
}
}
}
See how that goes...
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris M. <Chr...@te...> - 2002-09-10 21:33:51
|
just to update this I've also tried this construct
if (defined (my $foo = $apr->param($delete))) {
...
That I saw suggested on perlmonks
as well as something like
if (eval { $apr->param($delete) eq "on" }) {
....
'cause I couldn't think of anything else really.
What really gets me here is that I have another form of the same type with
checkboxes just like this and it works fine, and I can't find a single
difference in the code...
Thanks,
Chris
-----Original Message-----
From: Chris McDaniel [mailto:Chr...@te...]
Sent: September 9, 2002 7:32 PM
To: 'Chris Winters'
Cc: 'ope...@li...'
Subject: RE: [Openinteract-help] help with silly checkbox problem...
Hi,
Yes, I've actually tried that... and the eq as opposed to == thing - I
wasn't thinking when I wrote that in the email I guess ;-)
Anyway, here's what I've got right now... it's a bit of a mishmash of
different things I've tried. The input is from a form that displays a
number of records. When a record is changed, it sets a 'dirty' variable
(with javascript, a hidden field) so that I can tell which ones have
changed. $count comes from the form to indicate how many records have been
displayed. And, of course, the delete parameter is from a checkbox...
for $i ( 0 .. $count ) {
my $dirty = "dirty".$i;
my $delete = "delete".$i;
... (more variables)
if ($apr->param($dirty) == 1) { # if a given record has changed
my $ref = ref($apr->param($delete));
$R->scrib(0,"precommit: ref 330 $ref delete $delete ");
my $foo = $apr->param($delete);
$R->scrib(0,"foo $foo");
$foo = "off" unless $apr->param($delete);
if ($foo eq "on") {
... (delete type routine)
} else {
... (save type routine)
}
}
}
and this is what I get in the log - records 3, 4, and 6 have changed, 3 and
4 are to be deleted, 6 is not, and it dies...
OpenInteract::Handler::GenericDispatcher::_check_task_security (143) >>
Security after check for (precommit):
user has: 8; user needs: 8
testsite::Handler::Dns::precommit (305) >> precommit: count 18
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete3
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete4
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete6
testsite::Handler::Dns::precommit (333) >> foo
OpenInteract::UI::Main::handler (42) >> Action died. Here is what it left:
Not a CODE reference at
/var/www/testsite/pkg/dns-0.01/testsite/Handler/Dns.pm line 335.
I hope this isn't too much of a jumble...
Thanks again,
Chris
-----Original Message-----
From: Chris Winters [mailto:ch...@cw...]
Sent: September 9, 2002 6:09 PM
To: Chris McDaniel
Cc: 'ope...@li...'
Subject: Re: [Openinteract-help] help with silly checkbox problem...
* Chris McDaniel (Chr...@te...) [020909 17:46]:
> I'm having a huge problem with something that should be simple -
> I'm using a series of checkboxes on a page, and if they are checked, then
> everything is OK. But if they are not checked, then I have problems.
When
> I do something like this:
>
> if ($apr->param($delete) == "on") { # $delete is the name of the checkbox
> with an index, i.e. delete1, delete2, etc.
> ....
> }
My first impression is to split out what you're doing (plus use the
right comparison):
my $is_checked = $apr->param( $delete );
if ( $is_checked eq 'on' ) {
...
}
Other than that, are you having any other issues with Apache::Request?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone? Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390
_______________________________________________
openinteract-help mailing list
ope...@li...
https://lists.sourceforge.net/lists/listinfo/openinteract-help
|
|
From: Chris M. <Chr...@te...> - 2002-09-09 23:34:40
|
Hi,
Yes, I've actually tried that... and the eq as opposed to == thing - I
wasn't thinking when I wrote that in the email I guess ;-)
Anyway, here's what I've got right now... it's a bit of a mishmash of
different things I've tried. The input is from a form that displays a
number of records. When a record is changed, it sets a 'dirty' variable
(with javascript, a hidden field) so that I can tell which ones have
changed. $count comes from the form to indicate how many records have been
displayed. And, of course, the delete parameter is from a checkbox...
for $i ( 0 .. $count ) {
my $dirty = "dirty".$i;
my $delete = "delete".$i;
... (more variables)
if ($apr->param($dirty) == 1) { # if a given record has changed
my $ref = ref($apr->param($delete));
$R->scrib(0,"precommit: ref 330 $ref delete $delete ");
my $foo = $apr->param($delete);
$R->scrib(0,"foo $foo");
$foo = "off" unless $apr->param($delete);
if ($foo eq "on") {
... (delete type routine)
} else {
... (save type routine)
}
}
}
and this is what I get in the log - records 3, 4, and 6 have changed, 3 and
4 are to be deleted, 6 is not, and it dies...
OpenInteract::Handler::GenericDispatcher::_check_task_security (143) >>
Security after check for (precommit):
user has: 8; user needs: 8
testsite::Handler::Dns::precommit (305) >> precommit: count 18
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete3
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete4
testsite::Handler::Dns::precommit (333) >> foo on
testsite::Handler::Dns::precommit (331) >> precommit: ref 330 delete
delete6
testsite::Handler::Dns::precommit (333) >> foo
OpenInteract::UI::Main::handler (42) >> Action died. Here is what it left:
Not a CODE reference at
/var/www/testsite/pkg/dns-0.01/testsite/Handler/Dns.pm line 335.
I hope this isn't too much of a jumble...
Thanks again,
Chris
-----Original Message-----
From: Chris Winters [mailto:ch...@cw...]
Sent: September 9, 2002 6:09 PM
To: Chris McDaniel
Cc: 'ope...@li...'
Subject: Re: [Openinteract-help] help with silly checkbox problem...
* Chris McDaniel (Chr...@te...) [020909 17:46]:
> I'm having a huge problem with something that should be simple -
> I'm using a series of checkboxes on a page, and if they are checked, then
> everything is OK. But if they are not checked, then I have problems.
When
> I do something like this:
>
> if ($apr->param($delete) == "on") { # $delete is the name of the checkbox
> with an index, i.e. delete1, delete2, etc.
> ....
> }
My first impression is to split out what you're doing (plus use the
right comparison):
my $is_checked = $apr->param( $delete );
if ( $is_checked eq 'on' ) {
...
}
Other than that, are you having any other issues with Apache::Request?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|
|
From: Chris W. <ch...@cw...> - 2002-09-09 21:57:29
|
* Chris McDaniel (Chr...@te...) [020909 17:46]:
> I'm having a huge problem with something that should be simple -
> I'm using a series of checkboxes on a page, and if they are checked, then
> everything is OK. But if they are not checked, then I have problems. When
> I do something like this:
>
> if ($apr->param($delete) == "on") { # $delete is the name of the checkbox
> with an index, i.e. delete1, delete2, etc.
> ....
> }
My first impression is to split out what you're doing (plus use the
right comparison):
my $is_checked = $apr->param( $delete );
if ( $is_checked eq 'on' ) {
...
}
Other than that, are you having any other issues with Apache::Request?
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|
|
From: Chris M. <Chr...@te...> - 2002-09-09 21:34:56
|
I'm having a huge problem with something that should be simple -
I'm using a series of checkboxes on a page, and if they are checked, then
everything is OK. But if they are not checked, then I have problems. When
I do something like this:
if ($apr->param($delete) == "on") { # $delete is the name of the checkbox
with an index, i.e. delete1, delete2, etc.
....
}
I get "Not a CODE reference at
/var/www/testsite/pkg/dns-0.01/testsite/Handler/Dns.pm line 335." if the box
being tested is not checked.
There is no more detail in the log even with DEBUG set to 5 in server.perl
I've tried using ref() to figure out what it is, but it returns nothing.
I've tried using defined() to check it and use a flag in my if instead of
the actual $apr thing. I've tried a simple '$foo = "off" unless (
$apr->param($delete) );'
and I just can't make it work at all. Anyone have any thoughts?
Chris McDaniel
Service Development Architect
TELUS Business Solutions
Voice.416.883.4610 Cell.416.676.4654
|
|
From: Chris W. <ch...@cw...> - 2002-09-04 22:58:14
|
On Wed, 2002-09-04 at 17:53, Eric Reeves wrote: > > I just upgraded from SPOPS 0.64 and OI 1.41 to SPOPS 0.66 and OI 1.50, but > have run in to an issue w/ the migrate_to_filesystem.pl script. > > -- > > % sudo script/migrate_to_filesystem.pl > Using (/home/1stcontact.com/intranet) for 'website_dir'. > Can't use an undefined value as an ARRAY reference at > /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/ClassFactory/DefaultBehavior.pm > line 26. > > Where might this undefined value be coming from? I see the line in question (when the 'field' value of an SPOPS configuration is undefined), but this should have been defined earlier in the process.... Just for kicks, do something like: # cd $WEBSITE_DIR/pkg # find . -name "spops.perl" | xargs grep ' field ' And see if you have any items with one of: field => '' field => undef, If so, try changing them to: field => [], And see what happens. Clearly this is fragile and shouldn't be so. > Besides this, development has been coming along nicely (as time allows). > I'm continuing to like OI more and more. . (= Good to hear! If you're so inclined, you might want to write something up like John Sequeira's case study. This kind of work is always welcome! http://radio.weblogs.com/0103492/gems/notes.html Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Eric R. <er...@1s...> - 2002-09-04 21:53:33
|
I just upgraded from SPOPS 0.64 and OI 1.41 to SPOPS 0.66 and OI 1.50, but have run in to an issue w/ the migrate_to_filesystem.pl script. -- % sudo script/migrate_to_filesystem.pl Using (/home/1stcontact.com/intranet) for 'website_dir'. Can't use an undefined value as an ARRAY reference at /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/ClassFactory/DefaultBehavior.pm line 26. -- Where might this undefined value be coming from? Thanks yet again. Besides this, development has been coming along nicely (as time allows). I'm continuing to like OI more and more. . (= ----- Eric Reeves - Network / Systems Administrator 1st Contact Technologies - 281.333.1444 |
|
From: Chris W. <ch...@cw...> - 2002-09-03 16:05:52
|
* Ben Mathews (bma...@wi...) [020903 12:11]: > Is anyone else seeing this? I've contacted the site admin about this, thanks for the report. In the meantime, you can get all the online docs on the sourceforge[1] site and other information at the OI wiki[2]. Chris [1] http://sourceforge.net/docman/?group_id=16810 [2] http://openinteract.sourceforge.net/cgi-bin/wiki.pl -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988 |
|
From: Ben M. <bma...@wi...> - 2002-09-03 15:57:53
|
Is anyone else seeing this? Ben Mathews Wilcox Associates |
|
From: Chris W. <ch...@cw...> - 2002-08-30 11:29:41
|
On Thu, 2002-08-29 at 10:06, Arva, Adrian wrote: > I tried to apply the "News" package and I was getting errors for MAIN_SCRIPT > ... Thanks for the report: I just uploaded news-1.42 to the sourceforge site. This updated package also includes a demo script for creating an RSS feed from the news items. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris W. <ch...@cw...> - 2002-08-30 03:38:34
|
On Thu, 2002-08-29 at 13:06, Nick Sutterer wrote:
> I'm currently writing a little package to deliver cascading stylesheets
> according to the theme in use. I noticed that OI has different "display
> modes", like main or simple. Until now these two modes are hardcoded in
> OI::UI::Main and the respective entries in server.ini below
> [template_names] aren't read in, as a comment states.
Right. You can also set the template name manually with:
$R->{page}{_template_name_} = 'foo::bar';
It would be easy to create a central method that set this as necessary.
> Question: I think of using these "modes" to present different
> versions of *one* theme, like print- or wap-version... is this the way I
> should do it?
I don't think so. It's too complicated. (Make a note of the date: I
rarely say this :-) Why not just have a single theme (e.g., 'main') and
inherit from it for as many different types you need (e.g.', 'main_wap',
'main_print', etc.). Then you'd only have to override the items you need
for the different themes.
> If this is the right way, it would be cool to have more than 2 modes
> (Reading the comments in the source I think Chris is already working on
> that...). Another idea is to have more attributes for one mode - not only
> the pseudo name of the main template, but also stuff like the
> stylesheet to use etc. What do you think?
You should be able to do this now. Just add a key 'stylesheet_name' to
the main template and embed it in the 'main' template:
[%- theme = OI.theme_properties -%]
<html>
<head>
<link rel="stylesheet" type="text/css"
href="[% theme.stylesheet_name %]" >
...
(I'm not sure if that's the right way to grab an external stylesheet,
but you get the idea.)
Is that the sort of thing you were looking for?
> Something else: I can't figure out how to return a static page from the
> website html directory in a content handler. Help!!
Every static page needs a matching entry in the database. You can do
this using a scanner to pick up all non-existing pages: Click 'Page
actions' in the 'Admin Tools' box, then 'Scan' and enter the directory
you want to scan. This makes it easy to FTP a bunch of files to a
directory then scan it and have them all automatically added.
Later,
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris W. <ch...@cw...> - 2002-08-29 23:59:18
|
On Thu, 2002-08-29 at 19:01, Ben Mathews wrote: > I've got everything up and running for the most part on with a Win2000 > box w/ PostgreSQL and the latest versions of everything. After I did > the default configuration as specified in INSTALL.website, I got an > error in the log file > > --EXITED WITH ERROR from main handler eval block > Error: Can't call method "discover_properties" on an undefined value at > C:/Perl/site/lib/OpenInteract.pm line 351. > > For whatever reason, the theme attribute of the request handler isn't > getting set. I can't figure out why. Any suggestions? The theme isn't getting fetched properly. For starters, make sure the value in the server configuration key 'default_objects.theme' is the same as the theme ID in the database. If that's true, it's time for more debugging :-) Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Ben M. <bma...@wi...> - 2002-08-29 23:01:17
|
I've got everything up and running for the most part on with a Win2000 box w/ PostgreSQL and the latest versions of everything. After I did the default configuration as specified in INSTALL.website, I got an error in the log file --EXITED WITH ERROR from main handler eval block Error: Can't call method "discover_properties" on an undefined value at C:/Perl/site/lib/OpenInteract.pm line 351. For whatever reason, the theme attribute of the request handler isn't getting set. I can't figure out why. Any suggestions? Ben Mathews Wilcox Associates |
|
From: Nick S. <ni...@te...> - 2002-08-29 17:03:56
|
Hi all, I'm currently writing a little package to deliver cascading stylesheets according to the theme in use. I noticed that OI has different "display modes", like main or simple. Until now these two modes are hardcoded in OI::UI::Main and the respective entries in server.ini below [template_names] aren't read in, as a comment states. Question: I think of using these "modes" to present different versions of *one* theme, like print- or wap-version... is this the way I should do it? If this is the right way, it would be cool to have more than 2 modes (Reading the comments in the source I think Chris is already working on that...). Another idea is to have more attributes for one mode - not only the pseudo name of the main template, but also stuff like the stylesheet to use etc. What do you think? Something else: I can't figure out how to return a static page from the website html directory in a content handler. Help!! 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...> - 2002-08-29 15:14:35
|
* Arva, Adrian (ar...@cs...) [020829 10:21]: > I tried to apply the "News" package and I was getting errors for MAIN_SCRIPT > variable not being allowed under 'use script' pragma. > What I did was that I added: > > use constant MAIN_SCRIPT => '/News'; > > to OpenInteract/Handler/News.pm and after that everything was ok. > > Also, if you want to have the date values displayed in the news_form > template you have to use "date_object" as a variable name instead of > "object". > > I attached the template for you to check. I'll apply these (plus some other items) tonight and post the new package to the SF site. Thanks! Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988 |
|
From: Arva, A. <ar...@cs...> - 2002-08-29 14:08:14
|
Hi, I tried to apply the "News" package and I was getting errors for MAIN_SCRIPT variable not being allowed under 'use script' pragma. What I did was that I added: use constant MAIN_SCRIPT => '/News'; to OpenInteract/Handler/News.pm and after that everything was ok. Also, if you want to have the date values displayed in the news_form template you have to use "date_object" as a variable name instead of "object". I attached the template for you to check. <<news_form.tmpl>> _______________________________________________ Adrian Arva, Web Developer, Dolan DNA Learning Center |
|
From: Chris W. <ch...@cw...> - 2002-08-23 23:21:54
|
On Fri, 2002-08-23 at 17:14, Eric Reeves wrote: > Alright, figured it out. Apparently OI doesn't like having blank fields > in the data file, as in: > ... If a field will be defined in at least one of the records you need to include it, otherwise you can leave it out and it will be as if you didn't assign it a value when creating the object. > This data file was generated by a script which parsed a set of config > files. Not every config entry will contain every parameter, so there > -will- be undefined field values. Is there a way to make OI accept these > undefined field values, or does every field in field_order need to be > defined? Nope -- every field in field_order must have a value. I could have made the data items hashrefs instead, but most most bulk data loads it's easier to edit the values in order. If it's being auto-generated, then just stick an undef in there for those fields with no values. Who cares what the end result looks like :-) You could also write a script to do this by hand if that's easier -- instead of an intermediate step you could create a script that parsed the config and inserted the data in one fell swoop. (Let me know if you're interested in this.) > If I can't get OI to import this data I will just modify my config parsing > script and have it dump the data directly in to the OI-generated table. > No big deal. The only reason to keep this stuff with the package is if you will need to regenerate it -- you send the package to someone else who needs to start with the same data. Have fun! Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Eric R. <er...@1s...> - 2002-08-23 21:14:20
|
On Fri, 23 Aug 2002, Chris Winters wrote:
> From that it sounds like you might be doing something like:
>
> [ qw/ 1, Foo 55.0 / ],
>
> Since this is using 'qw' the first member is actually '1,' and if you
> try to treat it as a number your database might barf. It would be
> difficult to tell without looking at your data file.
>
Alright, figured it out. Apparently OI doesn't like having blank fields
in the data file, as in:
$data = [
{ spops_class => 'OpenInteract::NMS::Config::Host',
field_order => [ qw/ host_name alias address parents use name
register check_command max_check_attempts checks_enabled event_handler
event_handler_enabled low_flap_threshold high_flap_threshold
flap_detection_enabled failure_prediction_enabled process_perf_data
retain_status_information retain_nonstatus_information
notification_interval notification_period notifications_options
notifications_enabled stalking_options / ],
},
[ "", "", "", "", "", "default-host", "0", "check-host-alive",
"10", "", "", "1", "", "", "1", "", "1", "1", "1", "480",
"24x7", "", "1", "" ],
[ "wavelength", "wavelength", "66.101.60.4", "", "default-host",
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
"", "", "" ],
];
(Only 2 example rows included, as the rest of them mirror the format of
the 2nd row.)
This data file was generated by a script which parsed a set of config
files. Not every config entry will contain every parameter, so there
-will- be undefined field values. Is there a way to make OI accept these
undefined field values, or does every field in field_order need to be
defined?
If I can't get OI to import this data I will just modify my config parsing
script and have it dump the data directly in to the OI-generated table.
No big deal.
> Well, OI isn't 'pure' in any sense. Some of the functions are too
> complex and overdesigned and thus difficult to understand for
> newcomers. But, have faith: there is a light at the end of the tunnel!
> Once you get a handle on things you can create some very cool stuff.
>
I can see the light, and it's slowly getting larger. (=
-----
Eric Reeves - Network / Systems Administrator
1st Contact Technologies - 281.333.1444
|
|
From: Chris W. <ch...@cw...> - 2002-08-23 18:09:12
|
* Eric Reeves (er...@1s...) [020823 13:32]: > That was it; the data/SPOPS classes didn't match. Ah, good. > But it's still not happy! > > * Error: Cannot create SPOPS object! > Basic: DBD::Pg::st execute failed: ERROR: parser: > parse error at or near "," at > /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa > ce.pm line 288. > > I've run a check_package, and everything looks ok. I've double-checked my > data file, and it looks alright as well. So, I could use a point in the > right direction to locate my problem. From that it sounds like you might be doing something like: [ qw/ 1, Foo 55.0 / ], Since this is using 'qw' the first member is actually '1,' and if you try to treat it as a number your database might barf. It would be difficult to tell without looking at your data file. Another question: did any of the data actually get inserted? > This is my first real-world experience with OOP, so I'm still trying to > get a firm grasp on both OOP concepts and how they're utilized in OI. > I'm getting closer. (= Well, OI isn't 'pure' in any sense. Some of the functions are too complex and overdesigned and thus difficult to understand for newcomers. But, have faith: there is a light at the end of the tunnel! Once you get a handle on things you can create some very cool stuff. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988 |
|
From: Eric R. <er...@1s...> - 2002-08-23 17:20:15
|
On Fri, 23 Aug 2002, Chris Winters wrote:
> Make sure that your class name in your SPOPS configuration and your
> data file match up. For instance, looking at the base_theme package we
> have:
>
That was it; the data/SPOPS classes didn't match.
But it's still not happy!
* Error: Cannot create SPOPS object!
Basic: DBD::Pg::st execute failed: ERROR: parser:
parse error at or near "," at
/usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa
ce.pm line 288.
I've run a check_package, and everything looks ok. I've double-checked my
data file, and it looks alright as well. So, I could use a point in the
right direction to locate my problem.
This is my first real-world experience with OOP, so I'm still trying to
get a firm grasp on both OOP concepts and how they're utilized in OI.
I'm getting closer. (=
As always, thanks for your help, Chris.
-----
Eric Reeves - Network / Systems Administrator
1st Contact Technologies - 281.333.1444
|
|
From: Chris W. <ch...@cw...> - 2002-08-23 14:55:42
|
* Eric Reeves (er...@1s...) [020823 10:50]:
> It appears I've hit another road block, and I can't figure out what I'm
> doing wrong.
>
> I've created a .sql file containing my SQL structure, and a data file
> containing the initial object data. When I attempt to run an install_sql
> on my generated package, I get the following errors:
> ...
> Data:
> * Error: Can't locate object method "new" via
> package "Intranet::NMS" (perhaps you forgot to load
> "Intranet::NMS"?) at
> /usr/local/lib/perl5/site_perl/5.6.1/OpenInteract/SQL
> Install.pm line 264.
>
> Why is method 'new' being called from my class, Intranet::NMS?
> Basing off of the fruit example, there is no 'new' method, and data
> gets installed fine. So, I'm sure I've gone wrong somewhere. .
But there *is* a new method -- OpenInteract::SQLInstall will create a
new SPOPS object for every entry in the data file, fill it with the
entry's information and call save() on it to save it to the table.
Make sure that your class name in your SPOPS configuration and your
data file match up. For instance, looking at the base_theme package we
have:
base_theme/data/install_theme.dat:
----------------------------------------
$theme = [
{ spops_class => 'OpenInteract::Theme',
field_order => [ qw/ theme_id title description parent credit / ] },
... ];
base_theme/conf/spops.perl:
----------------------------------------
$spops = {
'theme' => {
class => 'OpenInteract::Theme',
When you install the package to your website, the 'OpenInteract::'
gets rewritten to your website package, which looks like 'Intranet::'
in your case. (Yes, this is confusing. It's going away in the next
version but that won't be for a little while yet.)
Other things to look for:
- Is your 'NMS' object using any code classes? Are these
syntactically ok? (What does a 'oi_manage check_package' do when you
run it in the development package directory?)
- Is your NMS object configured ok?
> Security:
> * Error: Cannot create SPOPS object!
> Basic: DBD::Pg::st execute failed: ERROR: Cannot
> insert a duplicate key into unique index
> sys_security_object_id_key at
> /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa
> ce.pm line 288.
These errors I wouldn't worry about; they just indicate you've
installed the security previously and it won't install again.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|
|
From: Eric R. <er...@1s...> - 2002-08-23 14:37:52
|
It appears I've hit another road block, and I can't figure out what I'm doing wrong. I've created a .sql file containing my SQL structure, and a data file containing the initial object data. When I attempt to run an install_sql on my generated package, I get the following errors: **************************** **************************** [ericr@wavelength] [/usr/local/OpenInteract/pkg/nms-0.01]> sudo oi_manage install_sql --package=nms [oi_manage]: Using (/usr/local/OpenInteract) for 'base_dir'. [oi_manage]: Using (/home/1stcontact.com/intranet) for 'website_dir'. Running install_sql... ========================= NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index 'nagios_host_cfg_pkey' for table 'nagios_host_cfg' Status of the packages requested for SQL install: nms (0.01) OK: Structure: * Created table from (create-table-nagios_host_cfg.sql): ok Data: * Error: Can't locate object method "new" via package "Intranet::NMS" (perhaps you forgot to load "Intranet::NMS"?) at /usr/local/lib/perl5/site_perl/5.6.1/OpenInteract/SQL Install.pm line 264. Security: * Error: Cannot create SPOPS object! Basic: DBD::Pg::st execute failed: ERROR: Cannot insert a duplicate key into unique index sys_security_object_id_key at /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa ce.pm line 288. Error: DBD::Pg::st execute failed: ERROR: Cannot insert a duplicate key into unique index sys_security_object_id_key at /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa ce.pm line 288. Important Notes ------------------------- none ========================= Finished install_sql! **************************** **************************** Why is method 'new' being called from my class, Intranet::NMS? Basing off of the fruit example, there is no 'new' method, and data gets installed fine. So, I'm sure I've gone wrong somewhere. . Thanks yet again. It is very much appreciated. ----- Eric Reeves - Network / Systems Administrator 1st Contact Technologies - 281.333.1444 |