Gossamer Forum
Home : Products : DBMan : Customization :

Long mod and relational mod

Quote Reply
Long mod and relational mod
After implemented the short/long mod and the relational mod in my databases.
While including the relational mod in the sub html_record works fine it doesn't work with the sub html_record_long.
I already searched the forum and found Elliot saying that it should work and many other not satisfying topics. So here is the problem:

When switching from short mod to long mod the first record (nh=1) works fine and displays all the records from the secound database. But the secound record (nh=2 and all the others) doesn't show any results. All I get is that the search found results ($status2 = OK) but no results are returned ($numhits2 = 0).

Thanx in advance for any suggestions,

Fisch

Quote Reply
Re: Long mod and relational mod In reply to
Please copy your html.pl file as a text file and then upload it to a publicly accessible directory in your server, and then post the URL to this text file, so that we can see the codes you are using.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Long mod and relational mod In reply to
You'll find the files at:

http://www.univie.ac.at/Psychologie/download/dbman/mitarbeiter-html_pl.txt
http://www.univie.ac.at/Psychologie/download/dbman/mitarbeiter_cfg.txt
http://www.univie.ac.at/Psychologie/download/dbman/buch_cfg.txt

thanx for helping me.

[This message has been edited by fischi (edited March 07, 2000).]
Quote Reply
Re: Long mod and relational mod In reply to
I do not see any of the calls to the switch routines as posted in the Relational Mod in either your sub html_record and sub html_record_long routine.

You need to add the switch call codes and also use $rec2 to call fields from the second database.

In addition, I am unsure which field is the common db_key between the two databases. It seems that in your mitarbeiter database, the db_key field is ID-Pers. And in your ID-Buch, right?

I would re-read the Relational Mod and add the switch codes in both the sub html_record and the sub html_record_long.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Long mod and relational mod In reply to
The code for the switch routine is in db.cgi and has the following structure:
Code:
{sub switch_to_buch {
#-----------------------------------------------------
@db_cols = qw(ID-Buch UserID Autoren Editor Jahr Buchtitel Verlag Verlagsadresse Abstrakt Edition Serie Recorddate LinkzuTitel LinkzuVerlag);
$db_file_name = $db_script_path . "/buch.db";
$db_sort{'Jahr'} = 'numer';
$db_key_pos = 0;
$db_key = 'Buch-ID';
$auth_modify_own = 0;
$auth_modify_own = 0;

}
# wechseln zu DB default

sub switch_to_mitarbeiter {
#-----------------------------------------------------
@db_cols = qw(ID-Pers UserID Titel Vorname Nachname Abteilung Status Postadresse Telefon Fax Sprechstunde e-MailAdresse Homepage Forschungsschwerpunkt);
$db_file_name = $db_script_path . "/mitarbeiter.db";
$db_key_pos = 0;
$db_key = 'ID-Pers';
$auth_modify_own = 1;
}

The common db_key is UserID. If I add the code, I use in html_record_long in html_record, all the entries of mitarbeiter.db plus the entries of buch.db are shown correct in the short display, but not in the long display, exept the very first entry, so it must be a problem with the long display and the nh=2 and so key. In case you want to see the results use dbtester/dbtester at http://www.univie.ac.at/psychologie/cgi-bin/dbman/db.cgi?db=mitarbeiter (I'm going to remove the account in 24 hours).

thanx again,

Fischi




[This message has been edited by fischi (edited March 07, 2000).]
Quote Reply
Re: Long mod and relational mod In reply to
Right...You have the correct sub-routines for the switching of the databases, however, I did not see the call to these routines in your sub html_record and sub html_record_long in the html.pl file.

Like the following:

Code:
my (%rec) = @_; # Load any defaults to put in the VALUE field.
&switch_to_mitarbeiter;
%rec2 = &get_record($rec{'ID-Pers'};
&switch_to_buch;
($db_auto_generate and print &build_html_record(%rec) and return);

And I did look at Record 6 located in the nh=2 page, and it looked exactly the same as Record 1 on the first page of results.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums


[This message has been edited by AnthroRules (edited March 07, 2000).]
Quote Reply
Re: Long mod and relational mod In reply to
The code is from the many to one relation in the original mod, since i do not need that relation i haven't included it.
Quote:
And I did look at Record 6 located in the nh=2 page, and it looked exactly the same as Record 1 on the first page of results.
Record 6 doesn't look like Record 1, since Record 1 has fields from buch.db and Record 6 not. In the dummy db you'll see that the numbers after the test correspont, vorname1 has title1, vorname2 has titel2......

What I found out while testing is, that the relational mod works fine for the first page of the search results, in short and long mod, but it never works for the second (nh=2) and the other pages. If i set maxhits to 30 i get 30 correct records for the first page but none for the secound page, so it must be a problem with the next hit page routine.

Unfortunately I'm not good in perl so i don't know where the failure is.

Fischi

Quote Reply
Re: Long mod and relational mod In reply to
Your failure resides in not putting the switch codes I have written in the sub html_record and sub html_record_long in your html.pl as I stated earlier.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Long mod and relational mod In reply to
While looking into the original mod documentation I found that code to be for the "many" side of the relationship.

I entered the code you posted but nothing changes, still the same problem.


[This message has been edited by fischi (edited March 09, 2000).]
Quote Reply
Re: Long mod and relational mod In reply to
Did anyone succeded in combining the relational mod and the short/long mod and is willing to let me look into his/her code od has any suggestions.

I haven't got any idea what I could do to get these two mods to work together and it is very important to me to match these two great mods.

Fischi
Quote Reply
Re: Long mod and relational mod In reply to
fischi:

I have successfully created a database using the User-friendly html.pl with Short/Long Display version.

I have just completed a whole file which lists all the changes that were necessary in all files to make the relational mod work between a users.db and five additional databases.

I would like someone to test this using my instructions and get some feedback to be sure that it is understandable as written prior to posting it in the resource section or otherwise providing the notes.

If you'd like to give my notes a try and provide feedback once you get it up and running, please send an email to:

dbman@creativecomputing1.com

I will send you the file via email.