Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Installation comments --

Quote Reply
Installation comments --
Here's what I did to get it to work, and everything works -- the instructions have to be refined a lot.

For whatever reason, my version would not create the new Index tables.

I had to manually edit the SQL.mysql file to add FOUR tables -- They are:

Code:

# SCORES TABLE
# =============================================================================
# Table structure for table 'Links_Scores_Index'
#

$Links_Scores_Index = qq~
CREATE TABLE Links_Scores_Index (
WordID mediumint(8) unsigned DEFAULT '0' NOT NULL,
item int(11) DEFAULT '0' NOT NULL,
score smallint(5) unsigned DEFAULT '0' NOT NULL,
position mediumint(8) unsigned DEFAULT '0' NOT NULL,
KEY WordID (WordID),
KEY item (item)
)
~;

# LINKS WORDS TABLE
# =============================================================================
# Table structure for table 'Links_Word_Index'
#

$Links_Word_Index = qq~
CREATE TABLE Links_Word_Index (
WordID mediumint(8) unsigned DEFAULT '0' NOT NULL auto_increment,
Word varchar(50) NOT NULL,
Frequency smallint(5) unsigned,
PRIMARY KEY (WordID),
UNIQUE Word (Word)
)
~;

# CATEGORY WORDS TABLE
# =============================================================================
# Table structure for table 'Category_Word_Index'
#

$Category_Word_Index = qq~
CREATE TABLE Category_Word_Index (
WordID mediumint(8) unsigned DEFAULT '0' NOT NULL auto_increment,
Word varchar(50) NOT NULL,
Frequency smallint(5) unsigned,
PRIMARY KEY (WordID),
UNIQUE Word (Word)
)
~;

# CATEGORY SCORES TABLE
# =============================================================================
# Table structure for table 'Category_Scores_Index'
#

$Category_Scores_Index = qq~
CREATE TABLE Category_Scores_Index (
WordID mediumint(8) unsigned DEFAULT '0' NOT NULL,
item int(11) DEFAULT '0' NOT NULL,
score smallint(5) unsigned DEFAULT '0' NOT NULL,
position mediumint(8) unsigned DEFAULT '0' NOT NULL,
KEY WordID (WordID),
KEY item (item)
)
~;


%TABLES = (
Links => $Links, Category => $Category, Search_Log => $Search_Log,
CategoryHeiarchy => $CategoryHeiarchy, CategoryRelations => $CategoryRelations,
CategoryAlternates => $CategoryAlternates, Validate => $Validate, Users => $Users,
Sessions => $Sessions, Editors => $Editors, Subscribe => $Subscribe, Hits_Track => $Hits_Track,
Rate_Track => $Rate_Track, Build_Update => $Build_Update, Verify => $Verify,
Links_Word_Index => $Links_Word_Index, Links_Scores_Index => $Links_Scores_Index,
Category_Word_Index => $Category_Word_Index, Category_Scores_Index => $Category_Scores_Index
);


This now creates all new .def files. This has a DOWN SIDE! It means you should keep a back up copy of your .def files if you make a lot of changes to them -- AND you should keep a copy of the Links.def and Category.def file that has all the "REQUIRED" fields set to '0'. This is _IMPORTANT_ during Import

After creating the tables, I edited the Links.def and Category.def files to reflect all required fields to be '0'

I verified that I had set all directory permissions, actually created the new database "Links" and that all the files were in the right places and Links.pl was properly filled out.

I then ran .../setup.cgi

Everything worked Great!! This program has a problem in that if you make a change to the SQL.mysql file you need to rerun the program COMPLETELY -- best to call it from a new browser window (or re-run it from telnet).

If you get any errors, look carefully. My #1 source of errors was when I made copies of the tables I didn't rename them properly so I had duplicate Links_Word_Index instead of one of those and one of Category_Word_Index.

Then, I ran Import.pl. I got no errors, but once I did get my server reporting an execution error at the end of the file -- but all the data got imported!

In about 5 minutes -- once I figured all this out, I can drop all the tables, recreate them, and re-import all the data.

ALEX -- everything works -- it just needs to be polished.

1) The table creation is missing from my version.

2) Why does required have to be set to '0' to import? Maybe you can make this a flag in the Import.pl so people who are willing to risk a little can easily import good data.

3) Next step -- an HTML config screen -- you have most of the parts, let people run the SETUP.CGI and let it ask for the Links.pm information, write it back, and reload itself to work on the database. For this, you can make the assumption that the Links.pm file is ../ from the setup.cgi.

There are -- or might be -- other little things, but this is what I've been doing now about 8 times to make sure it works.

It's definitely getting better!!

Now we need a good explanation of how to use the user.cgi since every time I try to have a user edit a record I get a "doesn't exist" error -- even when it does.

Quote Reply
Re: Installation comments -- In reply to
BTW -- the _easiest_ thing to do is if you have made modifications to the Links table -- custom fields -- just add them to the SQL.mysql file in the $Links definition. It should be pretty obvious how to do it.

Then, make the same changes to the $Validate table, and they will be in sync.

The $Validate table has TWO extra fields from the $Links table -- one is the LinkID (Needed, because the ID (auto-incrememt) field is the "Unique" id for the LInk in the Links table -- it has to be stored EXPLICITLY in any other table) and Mode -- which is used by the validate routines and is not used in the $Links table.

Everything else is the same. (except the $validate table has no extra indexes)
Quote Reply
Re: Installation comments -- In reply to
I think the problem lies because you were upgrading from 1.1beta. If you look in search.cgi you'll see:

print "\nCreating Search Indexes ... ";
eval {
my $DB2 = new Links: BSQL '../defs/Links.def';
$DB2->create_index();
$DB2 = new Links: BSQL '../defs/Category.def';
$DB2->create_index();
};

This should create the search indexes for you. If you are starting with an empty database, then when you create the table, the indexes should be created automatically.

I'll work on polishing the setup a bit more and making it a little smarter.

Cheers,

Alex
Quote Reply
Re: Installation comments -- In reply to
I'm not sure that's the case ... I tried with an empty database, and still couldn't get those tables to be created.

When I do it this way, it seems to work.