Chapter 24. Database Population Tools

Table of Contents

Command Line Tools
The wacspop command
vendors.xml - Vendor database initial load
photographers.xml - Photographer database initial load
keywords.xml - Keyword database initial load
attib.xml - Attributes database initial load
users.xml - users database initial load
Updating XML Files For wacspop

Command Line Tools

The task of the database population tool, wacspop is to read the XML files which come as part of the distribution and use the contents of those files to populate some of the database tables with some sensible initial values. At present it will create any new records that have not been previously seen but will not update existing records in any way.

[Note]Note

The wacspop was new in WACS 0.8.6 and replaced three previous seperate commands - vendpop, photpop and keywordpop. It is not 100% compatible with the older files as they had insufficent data in them for a single combined loading program. It is easy enough to convert the files, see the section called “Updating XML Files For wacspop below.

The wacspop command

There are currently five XML file types that understood by the wacspop command and they are:

vendors.xml - Vendor database initial load

Here wacspop reads the vendors.xml file and populates the vendors table with some useful example site (aka vendor) description records. These provide examples on how to configure the automatic download system as embodied in the chkmodel and getarc programmes, and should be directly usuable for any of the sites listed as soon as you add an appropriate username, password and subscription expiry date and set the subscription active.

photographers.xml - Photographer database initial load

Here wacspop reads the photographer.xml file and populates the photographer table with some useful example records. These will typically be photographers whose work has been encountered on a number of different websites and who have a corporate presence on the web. An initial selection of the most active circa 2011 is included in the XML file.

keywords.xml - Keyword database initial load

Here wacspop reads the keywords.xml file and populates the keyword table with some example keyword settings and priorities. There are about one hundred and fifty entries in the distributed file, which should provide some ideas on how the system works. Basically each keyword has entries for attributes, attire, locations and set types that it may provide clues to - each one of these is scored. The trick is to set the scores such that the presence of a sofa implies it's in a lounge, unless something else which binds stronger is also there. So if a photographer drags a sofa out into a garden for a given shoot, the "Garden" means Garden, Outside and takes preference over the "Sofa" means lounge rule. Take a look at Chapter 4, Naming Sets In WACS for more information and also use the wacskeywordmgr to have a look at the definitions we have already created for you.

attib.xml - Attributes database initial load

This is new one for Wacs 0.9.0 as the attributes table wasn't actually used in any previous release. One of the major changes in Wacs 0.9.0 is that the attributes mechanism is now entirely within the database (apart from some fallback code to keep old programs functioning). This file provides the initial load for all the standard attributes and their icons, a couple of new basic ones and a bunch of so-called new extended ones. As a result of this, it now becomes possible to add new attributes at will while other attributes can be recognised but not used if you so desire.

Unfortunately although we do plan to add a GUI tool to allow editing of the attributes database soon, it wasn't one of the priorities for the WACS 0.9.0 release and so isn't in this release. However if you read the details on the attrib schema in the Programming Manual and have basic familiarity with SQL, it's not that hard to add your own new definitions. This should be a marked improvement over the previous versions where adding new attributes involved editing the WACS module source code itself. This is also discussed in significant detail in the Chapter 18, Customisation chapter.

[Note]Note

If you loaded the sample data included with the earlier Wacs 0.8.6 release, you may want to delete that entirely as the final versions are somewhat different from those in the pre-release. If you haven't made any changes, the SQL command: delete from attrib; followed by a commit; and running wacspop with the Wacs 0.9.0 file will fix this.

users.xml - users database initial load

This simple XML file creates three basic user accounts: root, support and guest to allow the initial setup of a WACS system that wishes to use database authentication of users. Please make sure you change the passwords on all three accounts once you have the WACS system operational. Anyone looking at the WACS code will know what these initial passwords are!

They are currently: root - Svjck981, support - uKiFt126 and guest - freebie. Leave them unchanged at your peril!