Gossamer Forum
Home : Products : DBMan : Customization :

Information Management Solution

Quote Reply
Information Management Solution
Hi,

I am searching around the web for an information management solution. Your database script looks similar to what I need.

Perhaps you can help. I manage an non-profit academic site for a retired professor and I would like to store his papers in a searchable database. It would entail 4 levels of data:

1. The first page that visitors would see would be a link to different categories of papers he has written.
2. On the second page the visitor would see a listing of paper titles to choose from, preferably in chronological order by the date of publication.
3. Then, when the visitor chooses to click a paper title, this would take them to the paper abstract. On this page would be the abstract, plus there would be a link to the *full-text paper if it is available.
4. The last level of the database would display the *full-text paper (if it is available).

* Some of the papers are rather long, so I would not be able to paste them into a web form because of the character constraints. What I would like to do is have a second and third empty form so that any spill-over text could be entered to create new pages. This would mean that at the end of page one (if the paper is long) there would be a link to the next page with a "continue to page 2" link - and then, a page 3 if the paper was really long.

So, my questions is: Will this script do this? Can it be done? Can your script be modified to do this? If your script cannot do this, do you know a possible solution that I should look into?

Thanks so much for your time.

Sincerely,

Matthew Clapp
Editor, Sheldrake Online
http://www.sheldrake.org/
Quote Reply
Re: Information Management Solution In reply to
I think it could be done.

The first page would probably be a static html page with the categories listed and links to DBMan that would perform the search for papers in the category.

The second page would be a "short" display as has been talked about quite a bit in the forum. I have written a modification to allow for a "short/long" display which is available at http://www.drizzle.com/~hall/dbmod/short.txt

The third page would be the "abstract" page, the "long" display. You could keep the text of the abstract itself either in the database or in text files which the would load into the page when it is displayed.

The full text pages would probably need to be in separate text files. I suppose you could have a "super long" display routine for displaying them. As each page is loaded, it could check to see if there is a subsequent file for the paper and, if there is, would create a link at the bottom of the page for the next section. You would have to be careful in your selection of record keys and filenames for the text files, but it could be done.



------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
JPDeni,

What would I need to change around to have text files included in the database? Right now I am tinkering with default.cfg, and I will try to include the mod you suggested. Didn't you also post a mod here called format.pl? I tried the link in the archive and it was not working. Do you think you could post this when you have chance?

Thanks again,
Matthew
Quote Reply
Re: Information Management Solution In reply to
The "format.pl" mod was actually my "user-friendly html.pl" which included an extra file -- format.pl for folks to use if they have more than one database with the same format. I'm in the midst of revamping it. I'll try to work on it tonight and get it back up for you.

The text files for the full text of the papers should be just like html files, except without the <html>, <title> and <body> tags -- what you would put into the "meat" of a file. You can include html formatting, though, like <B>, <I>, lists, etc. And you'll want to put in <P> tags between paragraphs -- just like you would have on an html page.

As for the .cfg file, primarily you'll want to include things you'd like people to be able to search on. You can decide whether to include the abstracts in the database or have them in separate text files. If there are a lot of papers, you'll probably want them to be text files so that your database doesn't get too big.

I mentioned before being careful about naming your text files. If, for example, your ID for a paper was 234, you might name the abstract file "234abs.txt" and the files that make up the full paper "234text1.txt," "234text2.txt," etc. That way you'll be able to use the $rec{$db_key} variable to find the correct file to display.

If you'd like to see something like this in use, you can see my site. Go to
http://www.drizzle.com/~hall/cgi-bin/dbman/db.cgi?re=on&db=write&uid=default&last=%5EH&view_records=1
My site has submissions from visitors and the link above will give you a list of all the writings submitted by those whose last name starts with "H." (I'm just vain enough to give you a list that includes me. Smile )

I do suggest that you install the default database on your server before you try uploading your own configuration. (I don't know if you've done that yet or not.) In case there's a problem, it's much easier to figure out where the problem is if you take small steps.

I'll go work on the "user-friendly html" now and post here when it's back on the web.


------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
I got the user-friendly html.pl hack working great, thanks for posting that. Now, how do I include your suggestion above - to include the text files? I think this is a great idea.
Quote Reply
Re: Information Management Solution In reply to
You're welcome. Smile Sometimes I forget about things until someone specifically mentions them.

First the abstracts (because the main text will be a little more work, but the concept is the same).

If you're using my "short" mod, you'll have a subroutine called "html_record_long." Start the subroutine by printing out info from the record -- probably the title and the date and whatever else you want to put in there. All of that will be between a print qq| and a |;.

This next part is scripting, and not something that will go directly on the web page, so it is not within the print qq| statement.

Code:
$text_file_path = "/path/to/files";
$file = $rec{$db_key} . "abs.txt";
if (open (FILE, "$text_file_path/$file")) {
print <FILE>;
close FILE;
}
else {
print "Can't find it";
}

The variable $text_file_path is very important. It is not the URL, but the directory path on your server. All of your files should be in that directory. The abstract files are named as I suggested below. (You can name them something else if you want, but you'll have to change the code.)

One thing just occurred to me. It might not be a bad idea to have a field in your database to say whether the full text is available, since you said "if it [the full text] is available." It can be just a checkbox field. For my purposes, I'll call it "full."

If you do that, it's easy to print out the link to the full text.

After the code above, you'll probably want to have a space and maybe a divider bar or something to indicate the end of the abstract. Start a new print qq| statement and put your formatting in there. Then be sure to close it off with |;.

After that, add the following:

Code:
if ($rec{'full'}) {
print qq|<a href="$db_script_link_url&fulltext=1&view_records=1">
Read the full text of the paper</a>
|;
}

Give it a try. The link at the bottom of the abstract won't work yet, but what I'm interested in right now is seeing if the abstract prints. We'll get to the full text after we know this part works.

If, instead of the abstract, you get "Can't find it" on the page, either your text file is named something other than keyabs.txt or your path is wrong. I had to do a lot of playing around with the path before I got it right.


------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
I have the new "user-friendly html.pl" file up on my website. You can pick it up at http://www.drizzle.com/~hall/dbmod/html_pl.txt

------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
Wow, thanks for your quick response. I took a look at short.txt, but the first step was a little confusing to me. In the section, sub html_record, this code is confusing me:

Code:
$rec{$db_key} =~ s/<.?B>//g;
print qq|<TD>
<a href="$db_script_link_url&ww=on&$db_key=$rec{$db_key}&view_records=1">$rec{'field name'}</a>
</TD>|;

From what I have said in my initial message, what would be the best way for me to proceed to enable abstracts (as text files) to be shown on the following page? Thanks again for your help.

- Matthew
Quote Reply
Re: Information Management Solution In reply to
If you just want to have, for example, the title of your paper as the clickable link, you could just have the following as your entire html_record subroutine:

Code:
sub html_record {
my (%rec) = @_;

$rec{$db_key} =~ s/<.?B>//g; # this gets rid of any bold tags that might be in the field

print qq|<TD>
<a href="$db_script_link_url&ww=1&$db_key=$rec{$db_key}&view_records=1">$rec{'Title'}</a>
</TD>
}

The script will fill in all the variables (the words that start with "$"). The only thing you might need to change is
$rec{'Title'}

Change "Title" to whatever your field is that holds the title of the paper.


------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
I am now officially confused. Do you have a text file that had both the short and the user-friendly html.pl in the same html.pl file? I have gone through step by step and am still coming up with will errors. I finally did get something working, however the link that the title went to on the first page created an error page, rather than an abstract or full-text page?

I will make you a deal. If you can get code me a html.pl using my .cfg variables below, I will buy you the book or CD of your choice from Amazon.com and have it shipped to you next day delivery. I know it's not much, but you have helped me and so many people on this forum that this is just my way of saying thank you. Plus, I really need to get this job done and I am not too bright about this stuff ;-)

Code:
%db_def = (

id => [0, 'alpha', -2, 15, 0, '', ''],
title => [1, 'alpha', 40, 100, 1, '', ''],
authors => [2, 'alpha', 40, 100, 1, '', ''],
journal => [3, 'alpha', 40, 100, 1, '', ''],
abstract => [4, 'alpha', '40x3', 9000, 1, '', ''],
articletext => [5, 'alpha', '40x3', 50000, 0, '', ''],
articlelink => [6, 'alpha', 40, 255, 0, 'http://', '^http://'],
category => [7, 'alpha', 0, 255, 1, '', ''],
type => [8, 'alpha', 0, 60, 0, '', '']

);

You mentioned that I may need to change some of these variables above. If you catch something please let me know. I am still not clear on the whole .txt file linking this, though I think your idea is going to work great.

Thanks again and let me know if it is a deal..

Matthew
Quote Reply
Re: Information Management Solution In reply to
Now I'm confused. Smile I thought you were going to put your abstract and text into separate text files.

I think maybe we should take this to private mail. Send me email at hall@drizzle.com and we'll get you fixed up. Meanwhile, I'll go browsing at Amazon! Wink


------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
JP,

I have been trying to do the same thing for a long time and finally stumbled onto DBMAN. I followed the steps that were posted here on the short/long mod and was able to have it running.

One problem arised was that most of my description was way too long and I am afraid to store it all in one file. Could you be so kindly show me a way to have the description (in a long mode) stored in individual text file if there is such a way.

Your help is greatly appreciated.

Thanks,
Nickhung

Quote Reply
Re: Information Management Solution In reply to
Sure.

First, you have to name your files correctly. The best way to do it is to name them according to the record key. For example, if the key to a given record is 234, you'll want to name your text file 234.txt. Also, you need to have all the files in one directory.

Once you have that set up, go into your "long display" in html.pl.

Probably at the beginning of the subroutine, add a line to the path -- not the URL -- of the directory where your text files are. I know that it works to have the full path. Relative paths are kinda tricky.

Anyway, add a line like

$text_file_path = /path/to/text/files";

Then, where you want the text file to print out, add

Code:
|; # to close off any previous print qq| statement
$file = "$rec{$db_key}.txt";
if (open (FILE, "$text_file_path/$file")) {
print <FILE>;
close FILE;
}
else {
print "Can't find it";
}
print qq|

and continue on with the rest of your formatting.

That's it!


------------------
JPD





Quote Reply
Re: Information Management Solution In reply to
JP,

Wow, that was quick!...thanks.

I can see that this would display the long text file. What this mean is that the text file has to be created manually. Is there a way to have the text file created automatically during the add record window?

Thanks for your help,
Nickhung
Quote Reply
Re: Information Management Solution In reply to
There probably is a way, but I haven't worked it out yet. I'm going to need to work on it later for myself and I'll post it when I get it done, but I don't have time right now. Sorry.


------------------
JPD