Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
creating relations between tables

Posted by revtopo (revtopo), 11 July 2007
Hi all,

I have been writing scripts in perl to work with maypole(to create web interrface). in that i would like to create a database. i have starte up with the web interface but cant get the relation between the tables.

this is the code that am using:

TOPO->config->{display_tables} = [qw[VENTRY VENTRYABSTRACT]];
TOPO->config->{loader}->relationship($_) for
     ("VENTRY has VENTRYABSTRACT");

and the error am getting is


Use of uninitialized value in substitution (s///) at /jic-atidb/perl/lib/5.8.0/shellwords.pl line 16., referer: http://atidb.org/cgi-perl/gbrowse/atibrowse/
[Wed Jul 11 15:29:16 2007] [error] [client 149.155.200.3]
Use of uninitialized value in string ne at /jic-atidb/perl/lib/5.8.0/shellwords.pl line 17., referer: http://atidb.org/cgi-perl/gbrowse/atibrowse/

the error is pointing to the lines that i have included.

could any one help me out of this please.




Posted by KevinAD (KevinAD), 17 July 2007
since there is no regexp (s///) or "ne" operator in the lines you posted, they must not be the correct lines.

Posted by revtopo (revtopo), 17 July 2007
bu those are the erros at that time. can't even now what they speak about.

ok let me quote my other error am getting now. in the Maypole program its pointing error that:

Can't call method "class_of" on an undefined value at /home/jic-atidb/perl/lib/site_perl/5.8.0/Maypole.pm line 635, <DATA> line 1.\n, referer: http://www.atidb.org/topo
[Tue Jul 17 11:02:11 2007] [error] [client 149.155.221.157] Can't get() nothing! at /home/jic-atidb/perl/lib/site_perl/5.8.0/Maypole.pm line 640\n, referer: http://atidb.org/topo/ENTRY/view/IPR001241

the code used is  as folllows:


#!/jic-atidb/perl/bin/perl
package TOPO;
use warnings;
use Carp;
use base 'Apache::MVC';
use Class:BI::Loader::Relationship;
use Data:umper;
use Maypole::Constants;
use Maypole::Application;
my $title = "TOPO database. Very rudimentary interface as a starting point for development.";

TOPO->setup("dbi:mysql:topo_interpro2","nobody","",{AutoCommit => 1, PrintError => 1});
TOPO->config->{uri_base} = "http://atidb.org/topo/";
TOPO->config->{rows_per_page} = 20;
TOPO->config->{template_root} = "/jic-atidb/w3/topo/";
TOPO->config->{application_name} = $title;
TOPO->config->{display_tables} =[qw[DNA ENTRY ABSTRACT ANNOTATION REFDATABASE EXAMPLE PARENT PUBLICATIONID PUBLICATION SUPERMATCH XREFERENCE PROTEIN TAXONOMY]];

TOPO->config->{loader}->relationship($_) for
(" entry has abstracts");
1;

sub debug {
   return 2;
}
1;


could any one find were the error is
thnks.


Posted by KevinAD (KevinAD), 17 July 2007
I'm sorry but the many modules you are using are unfamiliar to me and make trying to help with specific errors impossble for me. But maybe this is part of the problem:

http://www.atidb.org/topo

the above URL is inaccessible without proper authorization.  

Posted by revtopo (revtopo), 17 July 2007
thanks for your reply,

thats not the problem. that is the web link were my database can be accessed. but sry only me and my supervisor could access that.

but any how access to that is not essential .
the progrm is written on 'maypole' an application program  which uses perl to write codes for their functioning.

however the problem is in the Class:BI( i think) which cant call the class or something like this.

thanks,

Posted by KevinAD (KevinAD), 17 July 2007
You could be right about where the problem is, I simply do not know. I can only suggest standard debugging procedures. Start with the simplest code possible and add to it one step at a time until you pin-point the source of the problem. Maybe that is where you arecurrently.  Hopefully someone else will know something that can help you. Maybe try another forum if you get no responses here.

Posted by revtopo (revtopo), 17 July 2007
hi kevin,

thanks for your reply. but i have debugged the progrm in unix which points the error to the DBI line. but i could not get why is that so are wat to do for that.


and i have tried with other forums too but i havent got any response still.



Posted by KevinAD (KevinAD), 18 July 2007
Maybe this line is the problem:

TOPO->config->{loader}->relationship($_) for
(" entry has abstracts");
1;


where is the value for  $_ coming from?

Posted by revtopo (revtopo), 18 July 2007

hi kevin,
yeah, the problem is with that line.

the errorrelated with tht is :

failed to resolve handler `TOPO': Can't call method "has_many" on an undefined value at /home/jic-atidb/lib/site_perl/5.8.0//Class/DBI/Loader/Relationship.pm line 96

but the $_ is the collection of all the tables that are in the topo_interpro2. what is my thought  is ,some thing is going wrong with the class dbi which cant make the relation.

that wil be surely silly but i cant get what that is

thanks





Posted by KevinAD (KevinAD), 18 July 2007
print $_ before the line that throws the errror and see what it's value is:

print "\$_ = $_";

the error says it's undefined which means it is empty or undef or 0 (zero).



Posted by revtopo (revtopo), 19 July 2007
hi

yeah that statement doesn't prodeuce any output.

but what?
can we initialise for that $_?

can that be something like this
$_ = " ";





Posted by KevinAD (KevinAD), 19 July 2007
[quote author=revtopo link=board=perl;num=1184164681;start=0#10 date=07/19/07 at 14:34:12]hi

yeah that statement doesn't prodeuce any output.

but what?
can we initialise for that $_?

can that be something like this
$_ = " ";

/quote]

It can be something like that: $_ = " " but I doubt that will help as that is an empty value. My feeling is you are doing something fundamentally incorrect. Since I have no knowledge of the modules you are using I can only suggest you find some documentation about how to use TOPO or Maypole correctly. That is as much help as I can offer at this point.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho