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...> - 2001-12-21 12:41:46
|
On Fri, 2001-12-21 at 02:54, Tho...@be... wrote: > Thank you. > > It works... Great! > But syntax should be like this: > ... > > otherwise you get a _fetch_object error. That goes to show what trying to do it by memory will do :-) Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: <Tho...@be...> - 2001-12-21 08:05:08
|
Thank you.
It works...
But syntax should be like this:
sub show {
my ( $class, $p ) =3D @_;
my $object_type =3D $class->MY_OBJECT_TYPE;
my $object_class =3D $class->MY_OBJECT_CLASS;
my $id_field =3D $object_class->id_field;
my $object =3D $p->{ object_type } ||=20
eval { $class->_fetch_object( $p->{id_field}, =
$id_field )
};
if ( $object ) {
return $class->SUPER::show({ $object_type =3D> $object });
}
return $class->SUPER::show({ edit =3D> 1, $id_field =3D> 1 });
}
otherwise you get a _fetch_object error.
Greets.
Thomas
-----Urspr=FCngliche Nachricht-----
Von: Chris Winters [mailto:ch...@cw...]
Gesendet: Donnerstag, 20. Dezember 2001 18:03
An: Tho...@be...
Cc: ope...@li...
Betreff: Re: [Openinteract-help] CommonHandler Display
On Thu, 2001-12-20 at 10:29, Tho...@be... wrote:
> Is it possible to call the handler method =
"package/show/?edit=3D1&id=3D1" by
> default ?
>=20
> Commonhandler uses search_form as default.
>=20
> I want, that the modify form appears by typing "$website/package"
Sure -- in the handler change the package variable 'default_method' (up
at the top of the handler) to 'show'.=20
Then to ensure that 'show' displays a form to edit object ID 1 by
default, you probably want to do something like:
sub show {
my ( $class, $p ) =3D @_;
my $object_class =3D $class->MY_OBJECT_CLASS;
my $id_field =3D $object_class->id_field;
my $object =3D $class->_fetch_object( $id_field );
my $object_type =3D $class->MY_OBJECT_TYPE;
if ( $object ) {
return $class->SUPER::show({ $object_type =3D> $object });
}
return $class->SUPER::show({ edit =3D> 1, $id_field =3D> 1 });
}
This checks to see whether the user has requested to display a
particular object and if not uses your default variable for the ID (1).
Hope this makes sense.
Chris
--=20
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris W. <ch...@cw...> - 2001-12-20 20:02:05
|
On Thu, 2001-12-20 at 14:57, Bill Moseley wrote: > At 02:53 PM 12/20/01 -0500, you wrote: > > > >Just curious -- what version of MySQL are you using? > > 3.22.32 There we go -- there's a note in the 'base' package (and there should be one in the 'base_security' package) about this. MySQL 3.22 and earlier don't like fields that have a 'default' but not a 'not null' to be used in a primary key or unique index. Follow the instructions in pkg/base-x.xx/INSTALL for the table specified there and any other ones you have. Hopefully that will TCB. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris W. <ch...@cw...> - 2001-12-20 19:53:09
|
On Thu, 2001-12-20 at 14:45, Bill Moseley wrote: > That looks somewhat OK, but I'm not sure what's an error and what isn't: > > base_security (1.53) > OK: > > Structure: > * Cannot execute table SQL > CREATE TABLE sys_security ( > ... > ) > > Error: DBD::mysql::db do failed: Column 'object_id' > is used with UNIQUE or INDEX but is not defined as > NOT NULL at > > No data installation done. > No security installation done. > /usr/local/lib/perl5/site_perl/5.6.0/OpenInteract/SQL > Install.pm line 136. Just curious -- what version of MySQL are you using? Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Bill M. <mo...@ha...> - 2001-12-20 19:45:42
|
At 08:44 AM 12/20/01 -0500, Chris Winters wrote:
>Can you drop the database and create a new one? (I'd recommend
>something other than 'test' since that frequently gets used by other
>programs.)
Sure. On my dev box I tend to use test for everything.
>And instead of running 'install_sql' by itself, try:
>
> $ export OIWEBSITE=/path/to/mysite
> $ oi_manage install_sql --package=INITIAL --sql_action=structure
That looks somewhat OK, but I'm not sure what's an error and what isn't:
base_security (1.53)
OK:
Structure:
* Cannot execute table SQL
CREATE TABLE sys_security (
...
)
Error: DBD::mysql::db do failed: Column 'object_id'
is used with UNIQUE or INDEX but is not defined as
NOT NULL at
No data installation done.
No security installation done.
/usr/local/lib/perl5/site_perl/5.6.0/OpenInteract/SQL
Install.pm line 136.
I'll append the full session below.
>If that works ok, then try:
>
> $ oi_manage install_sql --package=INITIAL --sql_action=all_data
>
>The message you included seems to indicate that the 'sys_security' table
>isn't getting created properly. If that isn't getting created then
>you'll have tons of problems. So separating the steps like this will
>make it easier to debug.
And again, with a new database called "oione" we get:
Error: DBD::mysql::st execute failed: Table 'oione.sys_security' doesn't
exist at /usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm line 506.
With lots of error output (which I didn't append below -- let me know if
you want it and I'll mail it off list).
Linux mardy 2.2.13 #1 Mon Nov 8 15:51:29 CET 1999 i686 unknown
I installed everything from CPAN yesterday. (I had quit a few dependencies
to install, too.)
> oi_manage --website_dir=/data/_g/lii/OItest test_db
Running test_db...
=========================
Status of the database test:
OK:
Status of connection <<main>> (default connection)
=========================
-- Basic connect: ok
-- Use database: ok
-- Create table: ok
=========================
Finished test_db!
lii@mardy:~ > export OIWEBSITE=/data/_g/lii/OItest
lii@mardy:~ > oi_manage install_sql --package=INITIAL --sql_action=structure
[oi_manage]: Using (/data/_g/lii/OItest) for 'website_dir'.
Running install_sql...
=========================
Status of the packages requested for SQL install:
base (1.63)
OK:
Structure:
* Created table from (sessions.sql): ok
* Cannot execute table SQL
CREATE TABLE object_keys (
object_key char(32) not null,
class varchar(75) not null,
object_id varchar(255) not null,
primary key ( object_key ),
unique ( class, object_id )
)
Error: DBD::mysql::db do failed: Specified key was
too long. Max key length is 256 at
No data installation done.
No security installation done.
/usr/local/lib/perl5/site_perl/5.6.0/OpenInteract/SQL
Install.pm line 136.
=========================
base_box (0.41)
OK: No installer defined, no changes made for package.
=========================
base_component (1.30)
OK: No installer defined, no changes made for package.
=========================
base_error (1.37)
OK:
Structure:
* Created table from (error.sql): ok
No data installation done.
No security installation done.
=========================
base_group (1.30)
OK:
Structure:
* Created table from (group_table.sql): ok
* Created table from (link_table.sql): ok
No data installation done.
No security installation done.
=========================
base_page (0.40)
OK:
Structure:
* Created table from (page.sql): ok
* Created table from (page_content.sql): ok
* Created table from (content_type.sql): ok
No data installation done.
No security installation done.
=========================
base_security (1.53)
OK:
Structure:
* Cannot execute table SQL
CREATE TABLE sys_security (
sid INT NOT NULL AUTO_INCREMENT,
class varchar(60) not null,
object_id varchar(150) default '0',
scope char(1) not null,
scope_id varchar(150) default 'world',
security_level char(1) not null,
primary key ( sid ),
unique ( object_id, class, scope, scope_id )
)
Error: DBD::mysql::db do failed: Column 'object_id'
is used with UNIQUE or INDEX but is not defined as
NOT NULL at
No data installation done.
No security installation done.
/usr/local/lib/perl5/site_perl/5.6.0/OpenInteract/SQL
Install.pm line 136.
=========================
base_template (1.27)
OK:
Structure:
* Created table from (template.sql): ok
No data installation done.
No security installation done.
=========================
base_theme (1.29)
OK:
Structure:
* Created table from (theme.sql): ok
* Created table from (theme_prop.sql): ok
No data installation done.
No security installation done.
=========================
base_user (1.45)
OK:
Structure:
* Created table from (user.sql): ok
No data installation done.
No security installation done.
=========================
lookup (0.18)
OK:
Structure:
No data installation done.
No security installation done.
=========================
object_activity (0.10)
OK:
Structure:
* Cannot execute table SQL
CREATE TABLE object_track (
objtrack_id INT NOT NULL AUTO_INCREMENT,
class varchar(50) not null,
object_id varchar(150) not null,
action varchar(10) default 'create',
action_by INT not null,
action_on datetime not null,
notes text null,
primary key ( objtrack_id ),
unique ( class, object_id, action, action_by,
action_on )
)
Error: DBD::mysql::db do failed: Column 'action' is
used with UNIQUE or INDEX but is not defined as NOT
NULL at
No data installation done.
No security installation done.
/usr/local/lib/perl5/site_perl/5.6.0/OpenInteract/SQL
Install.pm line 136.
=========================
results_manage (0.06)
OK: No installer defined, no changes made for package.
=========================
system_doc (1.28)
OK:
Structure:
* create_structure for mysql: no action taken
No data installation done.
No security installation done.
Important Notes
-------------------------
none
=========================
Finished install_sql!
Bill Moseley
mailto:mo...@ha...
|
|
From: Chris W. <ch...@cw...> - 2001-12-20 17:01:59
|
On Thu, 2001-12-20 at 10:29, Tho...@be... wrote:
> Is it possible to call the handler method "package/show/?edit=1&id=1" by
> default ?
>
> Commonhandler uses search_form as default.
>
> I want, that the modify form appears by typing "$website/package"
Sure -- in the handler change the package variable 'default_method' (up
at the top of the handler) to 'show'.
Then to ensure that 'show' displays a form to edit object ID 1 by
default, you probably want to do something like:
sub show {
my ( $class, $p ) = @_;
my $object_class = $class->MY_OBJECT_CLASS;
my $id_field = $object_class->id_field;
my $object = $class->_fetch_object( $id_field );
my $object_type = $class->MY_OBJECT_TYPE;
if ( $object ) {
return $class->SUPER::show({ $object_type => $object });
}
return $class->SUPER::show({ edit => 1, $id_field => 1 });
}
This checks to see whether the user has requested to display a
particular object and if not uses your default variable for the ID (1).
Hope this makes sense.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: <Tho...@be...> - 2001-12-20 15:40:50
|
Hello. Is it possible to call the handler method "package/show/?edit=1&id=1" by default ? Commonhandler uses search_form as default. I want, that the modify form appears by typing "$website/package" Greets Thomas |
|
From: Chris W. <ch...@cw...> - 2001-12-20 13:21:46
|
On Wed, 2001-12-19 at 20:29, Bill Moseley wrote:
> Status of the database test:
>
> OK:
> Status of connection <<main>> (default connection)
> =========================
> -- Basic connect: ok
> -- Use database: ok
> -- Create table: ok
>
> =========================
> Finished test_db!
>
> Looks good.
Yep
> I am running MySQL so I skipped step 4, but then step 5 failed. So jumping
> back to step 4:
>
> > oi_manage --website_dir=/data/_g/lii/OItest \
> > --driver=SPOPS::DBI::MySQL
> Usage:
> oi_manage [options] [command]
> ...
You shouldn't need to run step 4, but if you want to anyway this should
be:
oi_manage --website_dir=/data/_g/lii/OITest \
--driver=SPOPS::DBI::MySQL change spops_driver
You forgot the 'change_spops_driver' part :-)
> Ok, just to see the output from step five:
>
> > oi_manage --website_dir=/data/_g/lii/OItest \
> > --package=INITIAL \
> > install_sql
> Running install_sql...
> =========================
>
> SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
> ...
>
> Error: DBD::mysql::st execute failed: Duplicate entry '1-error_bgcolor'
> for key 2 at /usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm
> line 309.
>
> Now, "Duplicate" -- maybe it can only be run once??
Right. One part of 'install_sql' installs data for you -- trying to
insert that data again results in the above...
> Ok, scrolling back up in my window buffer for the first time I ran it:
>
> > oi_manage --website_dir=/data/_g/lii/OItest \
> > --package=INITIAL \
> > install_sql
> Running install_sql...
> =========================
>
> SPOPS::SQLInterface::db_discover_types (514) >> Failed to read data types:
> DBD::mysql::st execute failed: Table 'test.sys_security' doesn't exist at
> /usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm line 506.
Can you drop the database and create a new one? (I'd recommend
something other than 'test' since that frequently gets used by other
programs.)
And instead of running 'install_sql' by itself, try:
$ export OIWEBSITE=/path/to/mysite
$ oi_manage install_sql --package=INITIAL --sql_action=structure
If that works ok, then try:
$ oi_manage install_sql --package=INITIAL --sql_action=all_data
The message you included seems to indicate that the 'sys_security' table
isn't getting created properly. If that isn't getting created then
you'll have tons of problems. So separating the steps like this will
make it easier to debug.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Bill M. <mo...@ha...> - 2001-12-20 01:29:29
|
Hi Chris (and others),
Ok FINALLY getting around to installing OI.
Getting stuck at step 5 (or maybe step 4).
> oi_manage --website_dir=/data/_g/lii/OItest test_db
Running test_db...
=========================
Status of the database test:
OK:
Status of connection <<main>> (default connection)
=========================
-- Basic connect: ok
-- Use database: ok
-- Create table: ok
=========================
Finished test_db!
Looks good.
I am running MySQL so I skipped step 4, but then step 5 failed. So jumping
back to step 4:
> oi_manage --website_dir=/data/_g/lii/OItest \
> --driver=SPOPS::DBI::MySQL
Usage:
oi_manage [options] [command]
...
Ok, just to see the output from step five:
> oi_manage --website_dir=/data/_g/lii/OItest \
> --package=INITIAL \
> install_sql
Running install_sql...
=========================
SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
'db' => bless( {}, 'DBI::db' ),
'no_quote' => {},
'is_add' => 1,
'skip_cache' => 1,
'value' => [
'Background of error display box',
'error_bgcolor',
'#ff99cc',
1
],
'DEBUG' => 0,
'skip_log' => 1,
'table' => 'theme_prop',
'skip_security' => 1,
'field' => [
'description',
'prop',
'value',
'theme_id'
],
'return_sth' => 1
};
Error: DBD::mysql::st execute failed: Duplicate entry '1-error_bgcolor'
for key 2 at /usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm
line 309.
Now, "Duplicate" -- maybe it can only be run once??
Ok, scrolling back up in my window buffer for the first time I ran it:
> oi_manage --website_dir=/data/_g/lii/OItest \
> --package=INITIAL \
> install_sql
Running install_sql...
=========================
SPOPS::SQLInterface::db_discover_types (514) >> Failed to read data types:
DBD::mysql::st execute failed: Table 'test.sys_security' doesn't exist at
/usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm line 506.
SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
'db' => undef,
'is_add' => 1,
'skip_cache' => 1,
'value' => [
'3',
0,
8,
'TestSite::Handler::Package',
'g'
],
'skip_log' => 1,
'DEBUG' => 0,
'skip_security' => 1,
'table' => 'sys_security',
'field' => [
'scope_id',
'object_id',
'security_level',
'class',
'scope'
],
'return_sth' => 1
};
Error: DBD::mysql::st execute failed: Table 'test.sys_security' doesn't
exist at /usr/local/lib/perl5/site_perl/5.6.0/SPOPS/SQLInterface.pm line 506.
Bill Moseley
mailto:mo...@ha...
|
|
From: Chris W. <ch...@cw...> - 2001-12-20 00:34:18
|
On Wed, 2001-12-19 at 18:46, Chris McDaniel wrote:
>
> Is there a way to make a page auto refresh every 5 minutes in OI?
Sure -- this is just an HTTP thing. If you add something like the
following to base_main (the new part being the IF/END):
<html>
<head>
<title>[% page.title %]</title>
[% IF page.refresh -%]
<meta http-equiv="refresh"
content="[% page.refresh.time %];[% page.refresh.url %]">
[% END -%]
...
Then in your handler do:
$R->{page}{refresh} = { time => 300,
url => $R->{path}{original} };
Hope that makes sense. (I need to put a better interface around the
'path' and 'page' stuff...)
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: Chris M. <Chr...@te...> - 2001-12-19 23:51:57
|
Is there a way to make a page auto refresh every 5 minutes in OI? Thanks, Chris McDaniel |
|
From: Chris W. <ch...@cw...> - 2001-12-19 05:03:18
|
On Tue, 2001-12-18 at 18:53, Victor Piterbarg wrote: > I launched the first phase of the site I've been working on > http://www.nasaproracing.com. It's all done w/ OpenInteract. If you have an > interest, take a look. ------------------------------ [cwinters@genesee work]$ HEAD www.nasaproracing.com 200 OK Cache-Control: max-age=0 ... Title: Welcome to NASAProRacing.com! X-Powered-By: OpenInteract 1.36 ------------------------------ Excellent work! I'm going to need to create a page on the openinteract.org site for sites using OI.... > Seems to be running good so far. :-) > I haven't put up the shopping cart yet, still not sure what I want. Also, I > fixed my problem with the dynamic pages getting cached by recompiling apache > with mod_expires and setting the default expiration for text/html docs to 0. > Seems to be working. That's great it's working. Did the section in the mod_perl guide not work properly? (I'm curious just in case someone else asks about this...) > Some comments about the dev. process. This has been mentioned before, but I > did find the remove,export,install,apply cycle fairly tedious. I did write a > couple of shell scripts that made my life a lot easier, Send them over and I'll stick them in the distribution! > however, it would > definitely be a good idea to include some more developer-friendly > functionality in oi_manage. I am very open to suggestions on this. I tend to be a little myopic about the process (since I wrote it), and there are so many other things to do, etc. This may even require a rethinking as to the necessity of a base installation directory, since that was inspired by circumstances that don't seem to hold much sway anymore. > I also noticed that there is no nice way to yank > the package out of the root openinteract directory, in order to re-install > it. All it amounts to is taking the entry for your package out of > package_repository.perl and deleting the directory, so I just had my scripts > do it. What circumstances required you to re-install a package? That's the thing we should probably fix first :-) > The second thing was the security. I kept bumping into it and spending hours > figuring out what is wrong, only to discover that it's an object security > issue. That was primarily because I didn't really understand the structure > at first. So my advice is -- figure out the security scheme before > inheriting from SPOPS::Secure :-). Good point -- I'll remember to put this in the docs. > Third was importing data. I had about 8000 user profile records to import. I > imported everything fine into the DB, however then I had to create entries > for all of them in the sys_security table. Since every user record has to be > "owned" by the individual user, I wrote my own script to go through the user > profile table, and create security entry for each row. Ouch. There's a script to do this in the base_security package already. Oh well. > This is all well and > good, but it took me an hour to realize that it's a security issue, because > I didn't know that fetch_group() just skips the objects the current user has > no permissions for, without saying much. So I was pulling my hair for a > while. If you pass in a level for DEBUG you can get some additional feedback on SPOPS actions: my $list = $object_class->fetch_group({ DEBUG => 2 }); That said, the error handling is something I'm planning to modify before we get to SPOPS 1.0. Thanks for the update! Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Victor P. <ope...@ha...> - 2001-12-18 23:51:06
|
Hey everybody, I launched the first phase of the site I've been working on http://www.nasaproracing.com. It's all done w/ OpenInteract. If you have an interest, take a look. Hardware: VA Linux machine. Dual PIII 750Mhz 1GB RAM 16GB RAID 1 Software: OS: FreeBSD 4.4 Web: Apache/1.3.22, mod_perl 1.26, mod_ssl 2.8.5 OpenInteract 1.36 Database: MySQL 3.23.46, with InnoDB tables. Seems to be running good so far. :-) I haven't put up the shopping cart yet, still not sure what I want. Also, I fixed my problem with the dynamic pages getting cached by recompiling apache with mod_expires and setting the default expiration for text/html docs to 0. Seems to be working. Some comments about the dev. process. This has been mentioned before, but I did find the remove,export,install,apply cycle fairly tedious. I did write a couple of shell scripts that made my life a lot easier, however, it would definitely be a good idea to include some more developer-friendly functionality in oi_manage. I also noticed that there is no nice way to yank the package out of the root openinteract directory, in order to re-install it. All it amounts to is taking the entry for your package out of package_repository.perl and deleting the directory, so I just had my scripts do it. The second thing was the security. I kept bumping into it and spending hours figuring out what is wrong, only to discover that it's an object security issue. That was primarily because I didn't really understand the structure at first. So my advice is -- figure out the security scheme before inheriting from SPOPS::Secure :-). Third was importing data. I had about 8000 user profile records to import. I imported everything fine into the DB, however then I had to create entries for all of them in the sys_security table. Since every user record has to be "owned" by the individual user, I wrote my own script to go through the user profile table, and create security entry for each row. This is all well and good, but it took me an hour to realize that it's a security issue, because I didn't know that fetch_group() just skips the objects the current user has no permissions for, without saying much. So I was pulling my hair for a while. And of course, I would have shot myself if not for this list and Chris' amazingly prompt and informative responses. Thank you very much! -Victor |
|
From: Chris W. <ch...@cw...> - 2001-12-18 16:25:06
|
* John Sequeira (js...@me...) [011218 11:09]:
> I'm trying to create a has_a relationship between one of my classes and the
> OpenInteractive::User class.
> ...
> Then I changed it to
>
> has_a => { 'OpenInteract::User' => [ 'user_id' ], },
>
> and apache was happy, but now I'm not sure how to reference the object.
>
> I had thought $myobj->{user}->{login_name} would work, but it does not.
>
> I thought I followed the simple case mentioned in the 'has_a' docs,
> and although the there's example code in User->>Theme I couldn't
> find anything helpful.
Almost there, you should be able to use:
$myobj->user->{login_name};
The 'has_a' creates a method called 'user' (rather than a property, as
you were trying to access) that retrieves the relevant user object for
you.
Note that it's probably safer to do something like:
my $user = $myobj->user;
my $login_name = ( $user ) ? $user->{login_name} : 'Anonymous';
just in case $myobj doesn't have 'user_id' defined.
Note: Object relationships are getting rewritten, but it will
(hopefully) have much the same interface.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: John S. <js...@me...> - 2001-12-18 15:55:03
|
I'm trying to create a has_a relationship between one of my classes and the
OpenInteractive::User class.
I added the following line to the spops.perl class:
has_a => { 'user' => [ 'user_id' ], },
and received an error from Apache on startup
[Tue Dec 18 10:29:29 2001] [error] Can't locate object method "CONFIG" via
packa
ge "user" (perhaps you forgot to load "user"?) at
C:/Perl/site/lib/SPOPS/ClassFa
ctory/DefaultBehavior.pm line 183.
Compilation failed in require at (eval 15) line 1.
I tried addding :
alias => ['user'],
to the base_user/conf/spops.perl file (which should be redundant?), but not
luck.
Then I changed it to
has_a => { 'OpenInteract::User' => [ 'user_id' ], },
and apache was happy, but now I'm not sure how to reference the object.
I had thought $myobj->{user}->{login_name} would work, but it does not.
I thought I followed the simple case mentioned in the 'has_a' docs, and
although the there's example code in User->>Theme I couldn't find anything
helpful.
|
|
From: Chris W. <ch...@cw...> - 2001-12-17 21:59:49
|
* John Sequeira (js...@me...) [011217 16:38]: > Error logging on my system is croaking because of non-unique keys generated > on insert. Here's a log trace for your perusal: > ... Arg -- you're using Win32 as a server, right? There's something screwy with generating random numbers on Win32 that I haven't got a chance to look into yet. Just for kicks (since I probably won't get to this for at least a day or two), try going into $WEBSITE_DIR/conf/startup.pl And stick an: srand; just before the ApacheStartup call. Another option is comment out the 'srand;' call in OpenInteract::ApacheStartup->child_init() and see what happens. Thanks, Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: John S. <js...@me...> - 2001-12-17 21:28:00
|
Error logging on my system is croaking because of non-unique keys generated
on insert. Here's a log trace for your perusal:
SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
'db' => bless( {}, 'Apache::DBI::db' ),
'no_quote' => {},
'DEBUG' => 0,
'table' => 'sys_error',
'field' => [
'filename',
'notes',
'browser',
'type',
'user_msg',
'user_id',
'code',
'system_msg',
'session_id',
'referer',
'line',
'url',
'package',
'action',
'error_time',
'error_id'
],
'value' => [
'c:/src/www1/tmplib/Celebrity/Handler/Page.pm',
'',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000)
Opera 6.0 [en]',
'n/a',
'Requested file not found or cannot be opened',
'1',
314,
'/intra_menu.html',
'6ef2f7dbd4dd355c1b03f74d991fc2bd',
'http://127.0.0.1/NoTmpl/intra_menu',
210,
'/intra_menu.html',
'Celebrity::Handler::Page',
'n/a',
'2001-12-17 ',
'AOFVPMJXVTEW'
],
'return_sth' => 1
};
Error: DBD::mysql::st execute failed: Duplicate entry 'AOFVPMJXVTEW' for
key 1 at C:/Perl/site/lib/SPOPS/SQLInterface.pm line 309.
Celebrity::ErrorObject::fail_save (146) >> Error written out to
<<c:/src/www1/error/AOFVPMJXVTEW>>
Cannot save error 314: Error saving record to database at
C:/Perl/site/lib/SPOPS/DBI.pm line 653.
at C:/Perl/site/lib/OpenInteract/Error/System.pm line 234
Any thoughts on a workaround?
John Sequeira
http://www.pobox.com/~johnseq
jo...@po...
|
|
From: John S. <js...@me...> - 2001-12-17 21:27:40
|
Error loggin on my system is croaking because of non-unique keys generated
on insert. Here's a log trace for your perusal:
SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
'db' => bless( {}, 'Apache::DBI::db' ),
'no_quote' => {},
'DEBUG' => 0,
'table' => 'sys_error',
'field' => [
'filename',
'notes',
'browser',
'type',
'user_msg',
'user_id',
'code',
'system_msg',
'session_id',
'referer',
'line',
'url',
'package',
'action',
'error_time',
'error_id'
],
'value' => [
'c:/src/www1/tmplib/Celebrity/Handler/Page.pm',
'',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000)
Opera 6.0 [en]',
'n/a',
'Requested file not found or cannot be opened',
'1',
314,
'/intra_menu.html',
'6ef2f7dbd4dd355c1b03f74d991fc2bd',
'http://127.0.0.1/NoTmpl/intra_menu',
210,
'/intra_menu.html',
'Celebrity::Handler::Page',
'n/a',
'2001-12-17 ',
'AOFVPMJXVTEW'
],
'return_sth' => 1
};
Error: DBD::mysql::st execute failed: Duplicate entry 'AOFVPMJXVTEW' for
key 1 at C:/Perl/site/lib/SPOPS/SQLInterface.pm line 309.
Celebrity::ErrorObject::fail_save (146) >> Error written out to
<<c:/src/www1/error/AOFVPMJXVTEW>>
Cannot save error 314: Error saving record to database at
C:/Perl/site/lib/SPOPS/DBI.pm line 653.
at C:/Perl/site/lib/OpenInteract/Error/System.pm line 234
Any thoughts on a workaround?
John Sequeira
http://www.pobox.com/~johnseq
jo...@po...
|
|
From: John S. <js...@me...> - 2001-12-17 21:27:26
|
Error logging on my system is croaking because of non-unique keys generated
on insert. Here's a log trace for your perusal:
SPOPS::DBI::_save_insert (650) >> Insert failed! Args: $VAR1 = {
'db' => bless( {}, 'Apache::DBI::db' ),
'no_quote' => {},
'DEBUG' => 0,
'table' => 'sys_error',
'field' => [
'filename',
'notes',
'browser',
'type',
'user_msg',
'user_id',
'code',
'system_msg',
'session_id',
'referer',
'line',
'url',
'package',
'action',
'error_time',
'error_id'
],
'value' => [
'c:/src/www1/tmplib/Celebrity/Handler/Page.pm',
'',
'Mozilla/4.0 (compatible; MSIE 5.0; Windows 2000)
Opera 6.0 [en]',
'n/a',
'Requested file not found or cannot be opened',
'1',
314,
'/intra_menu.html',
'6ef2f7dbd4dd355c1b03f74d991fc2bd',
'http://127.0.0.1/NoTmpl/intra_menu',
210,
'/intra_menu.html',
'Celebrity::Handler::Page',
'n/a',
'2001-12-17 ',
'AOFVPMJXVTEW'
],
'return_sth' => 1
};
Error: DBD::mysql::st execute failed: Duplicate entry 'AOFVPMJXVTEW' for
key 1 at C:/Perl/site/lib/SPOPS/SQLInterface.pm line 309.
Celebrity::ErrorObject::fail_save (146) >> Error written out to
<<c:/src/www1/error/AOFVPMJXVTEW>>
Cannot save error 314: Error saving record to database at
C:/Perl/site/lib/SPOPS/DBI.pm line 653.
at C:/Perl/site/lib/OpenInteract/Error/System.pm line 234
Any thoughts on a workaround?
John Sequeira
http://www.pobox.com/~johnseq
jo...@po...
|
|
From: Chris W. <ch...@cw...> - 2001-12-17 12:48:30
|
On Mon, 2001-12-17 at 03:21, Tho...@be... wrote:
> Hi there.
>
> Some question about handling with templates:
> I want to insert a ticker in the base_main.tmpl. I created a package named
> "ticker" with 10 entries in th db for the content (ticker.ID0 -
> ticker.ID10).
>
> My question is, how do I include the pkg in the base_main ?
>
> I tried like this: [% INCLUDE $websitename::ticker %]
> and different combinations with the name.
>
> But nothings works. Is it possible at all?
The easiest way to do this is with a component. Here's how to set this
up -- names of classes, methods and templates are up to you :-)
1) In your 'ticker' package, create an entry in conf/action.perl for
your component. This is how OI knows how to connect your component call
with Perl code:
$action = {
ticker_embed => { class => 'OpenInteract::Handler::Ticker',
method => 'show_embedded' },
...
};
2) Create a method OpenInteract::Handler::Ticker->show_embeded:
sub show_embedded {
my ( $class, $params ) = @_;
my $R = OpenInteract::Request->instance;
my $ticker_entries = $R->ticker->fetch_group;
return $R->template->handler( {}, { ticker => $ticker_entries },
{ name => 'ticker::show_entries' } );
}
3) Create a template 'show_entries':
<p>Ticker Entries:<br>
[% FOREACH entry = ticker %]
[% entry.name %] --> [% entry.value %]<br>
[% END %]
4) Call the component:
[% OI.comp( 'ticker_embed' ) %]
You can pass parameters from the component call to the perl code also:
[% OI.comp( 'ticker_embed', num_entries = 5 ) %]
These parameters get put into the \%params argument passed to your
handler.
Hope this helps,
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|
|
From: <Tho...@be...> - 2001-12-17 08:31:45
|
Hi there. Some question about handling with templates: I want to insert a ticker in the base_main.tmpl. I created a package named "ticker" with 10 entries in th db for the content (ticker.ID0 - ticker.ID10). My question is, how do I include the pkg in the base_main ? I tried like this: [% INCLUDE $websitename::ticker %] and different combinations with the name. But nothings works. Is it possible at all? Greets. Thomas. |
|
From: Chris W. <ch...@cw...> - 2001-12-15 18:47:23
|
On Fri, 2001-12-14 at 15:28, Victor Piterbarg wrote: > Hello, > > It seems that IE is caching the dynamic pages that OI is generating. This is > not desireable behavior, since things change all the time. How would I go > about sticking no-cache into the headers generated by OI? Or this a TT > thing? Or is this just Apache config? Thanks. I think this is an IE thing, but you might be able to control it from the server side. See: http://perl.apache.org/guide/correct_headers.html#2_1_3_Expires_and_Cache_Control For some useful information. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Victor P. <ope...@ha...> - 2001-12-14 20:25:22
|
Hello, It seems that IE is caching the dynamic pages that OI is generating. This is not desireable behavior, since things change all the time. How would I go about sticking no-cache into the headers generated by OI? Or this a TT thing? Or is this just Apache config? Thanks. -Victor "Tatarsky, of course, hated most of the manifestations of Soviet power, but he still couldn't understand why it was worth exchanging an evil empire for an evil banana republic" --Viktor Pelevin, Generation P. |
|
From: Chris W. <ch...@cw...> - 2001-12-14 18:09:02
|
* Chris McDaniel (Chr...@te...) [011214 11:59]: > I'm starting to write a little app that needs to draw from 3 > different tables, but only needs to write to one of them. Is there > a way that I can pull them all into a single package (like multiple > definitions in the spops.perl or something)? I was looking at all > the system packages, and it seems like they are > one-table-per-package, with relationships between. Is that the > proper way to do it? You can do it any way you want -- to put multiple definitions in the conf/spops.perl file, just add new hash keys. Check out the file in the base_theme package for an example -- we define both a 'theme' and 'theme_property' object. If the app has objects that are closely related to one another, it's usually a good idea to put them in a single package. Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |
|
From: Chris M. <Chr...@te...> - 2001-12-14 16:48:49
|
Hi, I'm starting to write a little app that needs to draw from 3 different tables, but only needs to write to one of them. Is there a way that I can pull them all into a single package (like multiple definitions in the spops.perl or something)? I was looking at all the system packages, and it seems like they are one-table-per-package, with relationships between. Is that the proper way to do it? Thanks, Chris McDaniel |