Hi Guys,

Ok, I'll post what I am trying to do. I don't just want this done for
me, I want to understand it so I can develop this stuff on my own. But
at this point I can't wrap my mind around it.

I'm working on a small classified ad website. There will be several
main categories, such as Homes, Vehicles, Aircraft, etc. Each main
category has it's own set of tables. I want to build a catalog for
each main category. Even though each category is very similar in
structure (data base, forms, ad view) they are different enough that I
have to keep them seperate. That's really a design issue and a
different topic altogether.

I'm going to use the category Aircraft for this excercise. There are 4
tables that data is collected in. I'll put a bit of info about each
table (what kind of data it collects) behind the name.

Core (Primary Key ID, Title) - core record info
Details (price, color, # of seats, props) - detailed info, dynamic
content for each column (lots of varchars)
Features (leather, air conditioning) - all 'bit' yes/no data
Descriptions (5000 character description body)

Whenever an ad is created, I want to update the appropriate catalog
and create a new record for the ad. Now, I take it that I should only
have to create a catalog once. So what I planned on doing was created
a .cfm document called  "CreateAircraftCatalog.cfm" that would simply
hold the code to create the catalog.

So far I just have the following:

<CFCOLLECTION action="create" collection="aircraft_classifieds">

I've used this code to create a collection and did some various tests
(using sample code found on the web) to test that the catalog was
active. It was simple code to query the catalog and return the
records. Is it complete enough? Any guidance on how to make a better
catalog?

Now what I'm really stumped with is how to update/alter records in the
catalog. Here is the CFINDEX I have so far to update the catalog when
a new ad is listed. This code would directly follow the CFQUERIES used
to update the database.

<cfindex
action="update"
collection="aircraft_classifieds"
type="custom"
key="#CID#"
title="#FORM.title#"
URLpath="http://company.com/classifieds/classifieds.cfm?
fuseaction=aircraft_cv1&cid=#CID#"
body="FORM.title, FORM.price, FORM.description, FORM.ZIP">

Questions

1. in cfindex, there is a parameter called 'TYPE'. I set this to
custom since it wouldn't otherwise accept my value for the KEY
parameter. Is that right?

2. in cfindex, there is a parameter called 'KEY'. To my understanding
you would set this parameter to equal the 'unique key value' for each
record in the database. AKA, if an ad was record_id= 456, the 'key'
parameter would be set to 456. Is this correct? I thought the purpose
of this was to relate the record in the catalog to the record in the
database. For whatever reason, I'm thinking I don't understand this
correctly since I've also seen the KEY set to completely different
things, like a URL or a filepath.

3. in cfindex, there is a parameter called 'Title' and I would like to
set this to be equal to the 'title' of the ad. aka title would be set
to equal '1987 Cessna 8 seater plane - low flight time'

4. in cfindex, there is a parameter called 'URLpath' and I would like
to set this to the URL to view the ad. Basically, the result set given
by OPENBD after doing cfsearch and querying the catalog, I would like
the results to be displayed by showing the title, which is a link,
with the URL for the link being the URL found in the URLPATH variable.
Both the TITLE and URLPATH would be taken from the catalog.

5. for the body parameter, I just fill this with variables and content
that I want to be searched, correct? If so, I plan to just fill it
with data related to the ad. Price, age, location, description, etc.

This is all I need really. It seems that once I get this straightened
out, I can start assembling the catalogs and make them searcheable. As
it stands now, users can login, create ads, view the ads, edit them,
delete them, etc. I just don't have any way to search for them.

If anybody can help me get this straightened out, I would greatly
appreciate it!

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 mailing list - http://groups.google.com/group/openbd?hl=en

 !! save a network - please trim replies before posting !!

Reply via email to