Red Queen Review Engine User Manual

SUPPLIER RECORDS

Adjust Text:  a a a a
« Table of Contents   |   Obtain Red Queen »


SUPPLIER RECORDS

Suppliers are the entities one creates specifically to indicate the "source" of Items. If you allow Members to submit their own Items, then you can either REQUIRE that they create at least one Supplier account, and associate each submitted Item with a Supplier, OR you can allow them the OPTION of submitting without an associated Supplier, OR you can delegate the creation and assignment of Suppliers to either Admin or an Editor and require that your members submit Items WITHOUT an associated Supplier.

The first option is preferrable when your members are likely to want to set themselves up as "vendors" and submit "vendor" Items. The last option might be more useful if you want members to submit Items but you do not want them to litter your site with Supplier accounts. The second option allows for a middle ground.

When a member creates a Supplier account they create a record in your Supplier table. You can, however, also add your own Supplier accounts, or you may just use one such account to associate with all the Items that you personally enter into the database. Or you might not associate any Suppliers with the Items you create. Items without Suppliers are fine, too.

Once you have entered a Supplier into the Supplier table, and it has been allocated a Supplier ID of, say, 5, then you can navigate to the Supplier profile page via the browsable Yellow Pages (if it is not listed on any specific page you can always look up the Supplier alphabetically), or you can enter the URL to the Supplier profile page directly into your browser, like so:

http://www.mydomain.com/cgi-bin/path/to/...
	/redqueen/do/redqueen.cgi?module=profile_supplier&supplier_id=5

Creating a Supplier

As with the other "Creating a Thing" pages in this documentation, we cover here the procedure associated with adding a Supplier from the Database control panel, though you can also use the Yellow Pages Browser in the admin area to create records. If you're not sure how to get to the Database control panel, see Creating an Item.

From the Database menu on the Database control panel, select "Add" for the action and "Supplier" for the table. Click on the submit button to have the right frame load. You'll then see the following form elements (example input values have been added for clarity, and are explained below):

Supplier ID

A value will be assigned

Member ID

Supplier Name

Brief Description

Supplier Description

Homepage

Logo

Image

Contact Email

Contact Name

Contact Phone

Contact Fax

Street

City

Postal/ZIP code

State (if in U.S.)

Region (non U.S.)

Country

Stickiness

Is Validated

Solicit Reviews

Editable Supplier Fields

The following Supplier fields appear both on the Add Supplier and Modify Supplier pages, however three fields displayed above--Member ID, Stickiness, and Is Validated--only appear when the Administrator is logged in.

Supplier ID
Each Supplier record is uniquely identified by the Supplier ID (the actual column name is Supplier.id), a positive integer that represents the PRIMARY KEY for the table. This value is automatically created each time a new Supplier record is added to the table and is one greater than the Supplier ID value of the previous record to be inserted. In other words, the Supplier.id column is an AUTO INCREMENT field.

Member ID
Each Supplier account is "owned" by a Member. When a Member creates a Supplier account their own Member ID (the PRIMARY KEY for the Member table) is inserted automatcially for the record. If you create a Supplier from the admin area you'll need to supply the Member ID directly (presumably your own, which will usually be the value 1). The column is Supplier.member_id

Supplier Name
The Supplier Name is the human-readable form of the account identifier. It appears in select menus and Supplier lists on the Yellow Pages. The column is Supplier.known_as

Brief Description
The Brief Description field provides the short version of the Supplier Description field, and is displayed, for instance, on a Yellow Page listing of Suppliers when no other alternative Supplier bio is available (the Supplier can in fact supply separate brief description for every Yellow Page they appear on, if they wish). The column is Supplier.brief_description

Supplier Description
This is the full Description for the Supplier, and appears only on the Supplier Profile page. The column is Supplier.description

Homepage
This is the Supplier's web address, if supplied. The column is Supplier.url

Logo
The Logo field is optional and is based on an INT (integer) column which acts as a foreign key to the Upload table. To add a logo for the Supplier record click on the button marked "Manage Upload" and a dialog box will appear requesting information about the file to be uploaded. Once you have uploaded the image, a MIME icon and the name of the image file will appear on the Supplier record form itself, verifying that the image file is available before you even submit the Supplier record to the database. The column is Supplier.logo_image.

Image
The Image field is optional and, like the Logo, is based on an INT (integer) column which acts as a foreign key to the Upload table. The main difference here is that if you have enabled automatic image thumbnailing, a thumbnail of the uploaded image will also be stored along with the unscaled image and used where appropriate elsewhere in the program--such as on the Supplier detail page, or the Supplier Profile page. The column is Supplier.supplier_image.

Contact Email
Email address of the person or department that handles queries for the Supplier. The column is Supplier.contact_email.

Contact Name
The Contact Name is an optional name of a person to go with the Contact Email address. The column is Supplier.contact_name.

Contact Phone, Contact Fax
These optional fields are, respectively, the phone number and fax number for the Supplier. The columns are Supplier.contact_phone and Supplier.contact_fax.

Street, City, Postal/ZIP code
These 3 fields make up the physical address of your Supplier, and are entirely optional. The columns are Supplier.addr_street, Supplier.addr_city, Supplier.zipcode

State (if in U.S.)
If the Supplier is located inthe United States, use this field to provide the State in which the Supplier resides. Else see the Region field (next). The column is Supplier.state_id, which acts as a foreign key to the State table.

Region (non U.S.)
For Suppliers located outside the U.S. use the Region field to identify the State or Province. The column is Supplier.addr_region

Country
The country in which the Supplier is located. The column is Supplier.country_id, which acts as a foreign key to the Country table.

Stickiness
The Stickiness field is optional and is usually NOT used. This field controls where the Supplier will appear in an ordered list of Suppliers from the same Yellow Page. If left blank (the usual thing to do) the Supplier will assume its default position. But if you wish to promote the Supplier to the top of the list--something you might do if you are featuring a Supplier, perhaps because the Supplier is sponsored--then you assign a small integer for the stickiness (the column is a SMALLINT). The larger the stickiness value, the higher the Supplier appears in the list. Thus if you are featuring a single Supplier, you might assign a stickiness of 1. If you want another Supplier to appear higher in the list, assign that Supplier a number greater than 1. Stickiness only affects default orderings; if a user elects to order the Suppliers on a Yellow Page according to the average value of a given rating attribute, then the Supplier stickiness is ignored and the user gets the ordering they requested. The column is Supplier.stickiness

Is Validated
When a Member submits a Supplier for consideration, the value for the Is Validated field will be set to 'No', and remain that way until an Editor toggles it to 'Yes'. However, when adding Suppliers as the Administrator, you can set this to 'Yes' at the time you create the record if you wish. If you would like for certain members to be able to add Supplier profiles which are automatically validated and require no editor intervention, visit the Database control panel, pull up the member record in the User table, and toggle the User.supplier_auto_validation column to 'Yes'. A Supplier will only appear on a Yellow Page, or on an Item detail page, if it is validated. The column is Supplier.is_validated

Solicit Reviews
The Solicit Reviews field should be toggled to 'Yes' unless you do not wish for the Supplier to receive reviews and ratings from the community. When a Member creates a Supplier record they will specify the value for this field. The column is Supplier.solicit_reviews

Editable Non-Supplier Fields

In addition to the Supplier fields shown above, there may be other non-Supplier fields which appear on the Add Supplier and Modify Supplier pages. Yellow Page Editors and the Administrator are able to modify the Yellow Pages associated with a Supplier, so an extra form element will be present to handle this and will look something like the following (this demo form element is functional so you can play with it):

Yellow Pages

 

Yellowpage Pool

To assign a Yellow Page to the Supplier, select the Yellow Page from the pool in the lower part of the form element and click on "Assign Yellow Page" to pull it from the pool. To unassign a Yellow Page, select it from the list of assigned Yellow Pages in the top part of the form element and click "Return to Pool". When you finally submit the Supplier record the new Yellow Page assignments will also be recorded.

Note: You will discover if you try to remove all Yellow Pages from a Supplier record that you cannot do it. At least one Yellow Page will remain. This behavior may or may not change in the future. On the other hand, if a Member attempts to remove one of their Supplier accounts from a given Yellow Page via the public interface, they will have no problem doing so.

Note also that these forms are only present when editing records via the Database control panel. If you are using the Yellowpage Browser to add and edit records, look for the Copy link that appears next to each supplier in a yellowpage listing. You can copy the supplier to another yellowpage using point and click operations. But you can only do this for one yellowpage at a time.

Dealing With Thousands Of Supplier Associations

Like the situation involving Item/Category associations, there is an obvious limitation to the placement of a form on the page which allows the specification of Yellow Pages for a Supplier. If you have thousands of Yellow Pages in your database, the form will take a very long time to load in your browser. It may even crash your browser if sufficiently large. If this is the situation you face, you should instead elect to use the Yellow Page Browser to perform Supplier-related database additions and modifications (though for the most part you will probably leave this to the Members themselves). When you use the Yellow Page Browser you will find the potentially troublesome Yellow Page form has been removed. Instead, to modify the Yellow Page associations for a Supplier, you will find specific links to do so next to the Supplier within a Yellow Page Listing.

Adding New Supplier Fields

If you need to add extra fields to the Supplier table you can do this. Red Queen lets you add columns to any table that has a PRIMARY KEY. Each of these tables is listed in the Database menu found on the Database control panel. The Supplier table, of course, is one of them. For detailed information on the process of adding columns to existing tables, see ADDING COLUMNS TO A TABLE.

Do keep in mind when you add columns to the Supplier table that these new columns should probably have the Not Null attribute set to "No", so that the field can be regarded as OPTIONAL by Members. Otherwise, if a Member MUST supply the value, set the Not Null attribute to "Yes". When it comes to displaying an optional Supplier field in the templates it is not difficult to test for the existence of the column value before attempting to display it. For example, if you add an optional Supplier.established column, representing the first year the Supplier was open for business, you can test for the value with something like this:

	[% supplier = alias.supplier_info %]
		[%# assuming alias.supplier_info is passed into the template %]

	Established:
	[% IF supplier.established %]
		[% supplier.established %]
	[% ELSE %]
		year not provided...
	[% END %]

Here alias.supplier_info is the hash of Supplier information passed into the Template-Toolkit template that we are using to display the information, such as the template for the Supplier detail page. You should note that extra fields added to the Supplier table will automatically appear on the Supplier Profile page, so you need take no special action there after adding a new column.

A more detailed discussion of how to extract information from new columns is available in the sections entitled Adding New Item Fields and Understanding The Table Definition. The discussion in those 2 sections, while it pertains to column additions made to the Item table, nevertheless can be applied directly to column additions made to the Supplier table (just mentally replace the word 'item' with 'supplier' while reading...).

Suppliers also have a Supplier Profile associated with them. To include the information carried by new columns in the profile you'll need to edit the supplier_data.ttml template. Once you have studied the template it should become clear how to add tags to display the content of the new columns. If you need explicit instructions, consider reading the tutorial entitled HOW TO CREATE A GRAPHIC ARTIST REVIEW SITE which goes into the matter in great depth when consider how to add new columns to the Member table. Adding new columns to the Supplier table is done in an exactly analogous manner.

« Table of Contents   |   Obtain Red Queen »


Copyright © 2004 Random Mouse Software. All Rights Reserved.