NAME

Liz::CategorySet - CategorySet module


SYNOPSIS

 use Liz::CategorySet;

 $category = new Liz::CategorySet;


EXAMPLES

 #!/usr/local/bin/perl

 use Liz::CategorySet;


DESCRIPTION

The Liz::CategorySet package allows for very simple storage of sets of categories of many kinds. After the categories are stored in the database, it is possible to link ID's (any numerical value, but usually an ID that is generated by the NextID method of the Liz::SQL module) with one or more categories. When that is done, it is possible to select ID's according to one or more categories (AND or OR).


Incorporate into Client Module

The Liz::CategorySet module itself works best when incorporated into a client module because it moves the responsibility of aquiring a connection to a database to the client module and it allows any customisation to take place transparently to the developer.

Take for example the CategorySet method of HN.pm module:

 sub CategorySet {

 # Obtain the parameters
 # Start the category using the $hn handle as the database handle
 # Return the finished object

 my( $hn,$token ) = @_;
 my( $categoryset ) = Liz::CategorySet->new( $token,$hn );
 $categoryset;
 }

Because of the above code in HN.pm, it is now possible to write the following code:

 $hn = new HN;
 $categoryset = $hn->CategorySet( 'technology' );

Note that the database connection of the category is hidden in the creation of the $hn object.


CLASS METHODS

The following methods can be called without an object specification, but as a class method such as Liz::CategorySet->method().


categorysets

Return list of category identification names of all categorysets in the database specified. Usually not called by itself, but rather incorporated inside a Client Module.

Input Parameters

 1 wildcard specification to match
   (default: all)
 2 Liz::SQL compatible handle or reference to routine that performs connect
   (default: &Connect from caller's namespace)
Output Parameters

 1 reference to list of identification names in the current database
 2 reference to hash with full names
 3 reference to hash with database versions
Example

 $hn = new HN;
 ($id,$name) = $hn->CategorySets;
 $categorysets = @{$id};
 print "All $categorysets categorysets in Hospitality Net:\n";
 foreach( @{$id} ) {
   print " CategorySet '$$name{$_}' ($_)\n";
 }

In HN.pm:

 sub CategorySets { Liz::CategorySet->categorysets( $_[1],$_[0] ) }


new

Create a new Liz::CategorySet object. Creates connection or re-establishes connection with the MySQL database. Usually not called by itself, but rather incorporated inside a Client Module.

Input Parameters

 1 identification name of category set
   (default: default category set for database)
 2 Liz::SQL compatible handle or reference to routine that performs connect
   (default: &Connect from caller's namespace)
Output Parameters

 1 instantiated object
 2 flag: whether categoryset was just created
Example

 $hn = new HN;
 $category = $hn->CategorySet( 'technology' );

In HN.pm:

 sub CategorySet { Liz::CategorySet->new( $_[1],$_[0] ) }


reset

Delete all tables of the CategorySet object. Please use this with caution, as it will destroy any information that is stored for this CategorySet. If called in a void context, no tables exist for this CategorySet anymore, and any references in the NextID table are also removed. Otherwise, the tables will be re-created automatically and a new object will be returned, just as if the new method was called.

Output Parameters

 1 newly created CategorySet object, current object will not work anymore
Example

 $categoryset->reset;
Example

 $categoryset = $categoryset->reset;


CONTENT METHODS

The following methods allow changes to information that is associated with an entire categoryset.


delete

Delete one or more categories from the Liz::CategorySet database without first having to create an object for each category to be deleted.

Input Parameters

 1..N category ID's to be deleted
Example

 $hn = new HN;
 $category = $hn->CategorySet( 'technology' );
 $category->delete( 3000320,3000321 );


FillIDsInObject

Set ID fields in the specified object from the field names specified. Adds ``ID'' to each field name for the field to be set with the ID value.

This quickly translates any names in the object to their ID's simply by specifying the field names. It is assumed that there is a field with the name 'PARENT' followed by the name if the ID field, that contains the parent ID of the category to which the name belongs. Top level categoris are assumed if this field does not exist.

Use method FillNamesInObject to translate name values to ID's.

Input Parameters

 1    object in which to set fields
 2..N names of fields to convert from name to ID
Example

 # sets fields CITYID, STATEID and COUNTRYID from CITY, STATE and COUNTRY
 $categoryset->FillIDsInObject( $self,qw(CITY STATE COUNTRY) );


FillNamesInObject

Set name fields in the specified object from the field names specified. Adds ``ID'' to each field name for the field to be read for the ID value.

This quickly translates any ID's in the object to their names simply by specifying the field names. Use method FillIDsInObject to translate field values to ID's.

Input Parameters

 1    object in which to set fields
 2..N names of fields to convert from ID to name
Example

 # sets fields CITY, STATE and COUNTRY from CITYID, STATEID and COUNTRYID
 $categoryset->FillNamesInObject( $self,qw(CITY STATE COUNTRY) );


IDs2NameHash

Return the names of one or more categories specified by ID as a reference to a hash which is keyed to the ID's.

Input Parameters

 1..N ID's of categories to search for
Output Parameters

 1    reference to hash of names keyed to the ID's
Example

 $names = $hn->IDs2NameHash( @ID );
 foreach( keys %{$names} ) {
   print "$_: $$names{$_}\n";
 }


IDs2Names

Return the names of one or more categories specified by ID as a list. If the name of the category is not found, a '' will be made available as the name.

Input Parameters

 1..N ID's of which to obtain the names
Output Parameters

 1..N associated names
Example

 foreach( $hn->IDs2Names( @ID ) ) {
   print "$_\n";
 }


Name

Specify or return the current name of the categoryset object. The name can be anything to further identify the goal of the categoryset.

Input Parameters

 1 new name of categoryset
   (default: no change)
Output Parameters

 1 current/old name of categoryset
Example

 $xxlink = new xxLINK;
 $categoryset = $xxlink->CategorySet( 'eurest' );
 $categoryset->Name( 'Eurestjes' );


Names2IDHash

Return the ID's of one or more categories specified by name as a reference to a hash which is keyed to the names. If the name of the category is not found, a '0' will be made available as the ID.

Use method NameAlways2ID to always obtain a valid ID for a category name by inserting a new category if it doesn't exist yet.

Input Parameters

 1    parent ID to which the categories should belong
      (default: top list categories = 0)
 2..N names of categories to search for
Output Parameters

 1    reference to hash of ID's keyed to the names
Example

 $IDs = $hn->Names2IDHash( @name );
 foreach( keys %{$IDs} ) {
   print "$_: $$IDs{$_}\n";
 }


NameAlways2ID

Return an ID for a given category name, even if the category does not exist yet. In the latter case, insert a new category with the given parameters.

Input Parameters

 1 name of the category of which to obtain an ID
 2 parent ID or name to which the category should belong
   (default: top list categories = 0)
 3 status to be assigned to category if new
   (default: 0)
 4 options to be assigned to category if new
   (default: none)
Output Parameters

 1 ID of category
   (0 if error, such as no name specified)
Example

 $ID = $hn->NameAlways2ID( 'Apenootjes' );


NameAlways2ParentIDFields

Set one or more fields in an object for a given parentID and a list of names. The names of the fields are created from the name by making the name uppercase and inserting 'PARENT' in front of it. Shortcut to NameAlways2ID. Usually used in the initialization part of a module.

Input Parameters

 1    object in which to set the fields
 2    parentID to be used
 3..N names for which to find an ID
Example

 $categoryset->NameAlways2ParentIDFields( $self,$parentID,
  'categoryID','editionID,'mediumID' );


Names2IDs

Return the ID's of one or more categories specified by name as a list. If the name of the category is not found, a '0' will be made available as the ID.

Use method NameAlways2ID to always obtain a valid ID for a category name by inserting a new category if it doesn't exist yet.

Input Parameters

 1    parent ID to which the categories should belong
      (default: top list categories = 0, -1 = any parent ID)
 2..N names of categories to search for
Output Parameters

 1..N associated ID's
Example

 foreach( $hn->Names2IDs( 0,@name ) {
   print "$_\n";
 }


ParentID

Return the distinct parent IDs of a one or more category ID's. Can of course also be used to obtain the parentID of a single category ID.

Input Parameters

 1..N ID's of the categories of which to obtain the ParentIDs
Output Parameters

 1..N ID's of the different parent categories found


ID METHODS

The following methods all apply to associating ID's with one or more categories.


CategorySetIDs

Associate a list of ID's with a Category. This is the basically the same action as IDSetCategoryList but based on the name or ID of a category, rather than on an (external) ID.

Input Parameters

 1    ID or name of category to associate ID's with
 2..N ID's to associate with the category
Example

 $categoryset->CategorSetIDs( $editID,@wekenID );


Categories2IDs

Returns all ID's that are associated with one or more categories.

Input Parameters

 1    flag: whether OR (0) or AND (-1) or number of matches (>0)
      (default: OR)
 2    name of table for which to return ID's only (optional)
      (default: all possible ID's)
 3..N ID's of categories for which to search
Output Parameters

 1..N ID's that are associated with the indicated categories
Example

 @ID = $categoryset->Categories2IDs( 0,@selected );
Note

Returns all ID's with categories associated if no category ID's are specified.


IDAddCategoryList

Add one or more categories to the current list of categories associated with an ID. This will keep any categories that are listed with the ID and add new ones if they don't appear in the list of associated categories yet.

Use method IDSetCategoryList to replace the list of associated categories by another one.

Input Parameters

 1    ID to add the list of categories to
 2..N ID's of categories to associate also with the ID
Example

 $hn->IDAddCategoryList( $vendorID,@extra );


IDDeleteCategoryList

Delete one or more categories from the current list of categories associated with an ID. This will keep any other categories that are listed with the ID.

Use method IDSetCategoryList to replace the list of associated categories by another one.

Input Parameters

 1    ID to delete the list of categories from
 2..N ID's of categories to disassociate with the ID
Example

 $hn->IDDeleteCategoryList( $vendorID,@nomore );


DeleteCategoryFromSet !UNFINISHED!

Delete one or more categories from the current set. This will all categories supplied from all IDs in the set.

Input Parameters

 1..N ID's of categories to disassociate from all IDs
Example

 $hn->DeleteCategoryFromSet( @nomore );


IDCategoryLists2IDs

Return ID's or references to the ID's associated with the given ID and one or more parent ID's. Particularly useful when obtaining a list of values from the categoryLIST associated with a single ID in a CheckBox, RadioButton or Pulldown situation.

This method assumes that there may be more than one category ID associated with any given combination of ID and parent ID. To handle cases where only one category ID can be returned per parent ID, make sure you specify ``1'' as the second input parameter.

Input Parameters

 1    ID to obtain the list of categories from
 2    flag: (default: only return first ID)
       0 only return first ID
       1 return references to lists of ID's
       2 only return first name
       3 return references to lists of names
 3..N parentIDs or names of the parent categories associated with the ID
Output Parameters

 1..N (references to) ID's of categories associated with ID and given parentID
      (default: set variables in caller's namespace if names specified)
Example

 ($cpuID,$videoID,$memoryID) =
  $xxlink->IDCategoryLists2IDs( $ID,0,$ccID,$vcID,$mcID );

 $xxlink->IDCategoryLists2IDs( $ID,0,qw(cpu video memory) ); # same as above

 ($harddiskID,$accessoryID) =
  $xxlink->IDCategoryLists2IDs( $ID,1,$hcID,$xcID );
 ($harddiskID1,$harddiskID2) = @{$harddiskID};
 @accessoryID = @{$accessoryID);

 $xxlink->IDCategoryLists2IDs( $ID,1,qw(harddisk accessory) ); # almost same


IDCategoryListUpdated

Return timestamps of when the Category List of the specified ID was last updated.

Input Parameters

 1 ID to obtain the timestamps from
Output Parameters

 1 last updated timestamp
 2 created timestamp
Example

 FrozenContents( $updated,$emotion->IDCategoryListUpdated( $ID ) );


IDGetCategoryList

Return the list of ID's associated with the given ID. Optionally limit the categories only to those belonging to a given parent. Use method IDSetCategoryList to set the list of associated categories.

Input Parameters

 1    ID to obtain the list of categories from
 2    parentID of the categories to be returned only
      (default: return all categories)
Output Parameters

 1..N ID's of categories associated with the ID
Example

 foreach( $hn->IDGetCategoryList( $vendorID ) ) {
   print "ID=$ID\n";
 }


IDSetCategoryList

Replace the current list of categories associated with an ID with the list of categories specified. Can also be used to remove all categories.

Use method IDGetCategoryList to obtain the list of ID's associated with an ID.

Input Parameters

 1    ID to set list of categories of
 2..N ID's of categories to associate with the ID
      (default: remove all categories associated with this ID)
Example

 $hn->IDSetCategoryList( $vendorID );
 $hn->IDSetCategoryList( $vendorID,@categories );


IDs2FrequencyHash

Return a reference to a hash keyed to all the different categories found associated with a list of external ID's. The values in the hash are the frequences with which the categoryID's occur.

Input Parameters

 1..N external ID's of which to calculate the frequency
Output Parameters

 1    reference to a hash containing the frequencies keyed to categoryID's
 2    total number of categoryID's found
Example

 $freq = $categoryset->IDs2FrequencyHash( @externalID );
 foreach (keys %{$freq}) {
   print "$_: $$freq{$_} times\n";
 }


HTML METHODS

The following methods create HTML of Liz::Perl's pseudo HTML from information in a categoryset.


ID2Check

Return the HTML for check boxes of a specific category specified by ID or name of a main category (with parent 0).

Input Parameters

 1 ID or name of the category of which to return a checkbox sequence
   (default: the last used parent ID)
 2 name of list (in the caller's namespace to match)
 3 extra HTML to be added between CHECK boxes
   (default: none)
 4 flag: return pseudo HTML in <CHECK...> form
   (default: real HTML)
 5 extra condition to be used
   (default: none)
Output Parameters

 1 HTML of complete checkbox sequence
Example

 <FORM>
 <PRINT "$categoryset->ID2Check( 'Zappoflips','zappoflip' )">
 <PRINT "$categoryset->ID2Check( $categoryID,'category' )">
 </FORM>


ID2Pulldown

Return the HTML for a pulldown menu of a specific category specified by ID or name of a main category (with parent 0).

Input Parameters

 1 ID or name of the category of which to return a pulldown menu
   (default: the last used parent ID)
 2 name of variable in the caller's namespace to match
 3 extra HTML to be added at the beginning
   (default: none)
 4 flag: return pseudo HTML in <PULLDOWN...> form
   (default: real HTML)
 5 flag: extra fields (0=empty field, 1=no empty field, ref(@list)=extra fields)
   (default: add empty field at beginning)
 6 extra condition to be used
   (default: none)
Output Parameters

 1 HTML of complete pulldown menu
Example

 <FORM>
 <PRINT "$categoryset->ID2Pulldown( 'Zippoflaps','zippoflaps' )">
 <PRINT "$categoryset->ID2Pulldown( $categoryID,'category' )">
 </FORM>


ID2Radio

Return the HTML for radio buttons of a specific category specified by ID or name of a main category (with parent 0).

Input Parameters

 1 ID or name of the category of which to return a radio button sequence
   (default: the previously used parent ID for this object)
 2 name of variable in the caller's namespace to match
 3 extra HTML to be added between RADIO buttons
   (default: none)
 4 flag: return pseudo HTML in <RADIO...> form
   (default: real HTML)
 5 extra condition to be used
   (default: none)
Output Parameters

 1 HTML of complete radio button sequence
Example

 <FORM>
 <PRINT "$categoryset->ID2Radio( 'Zippoflaps','zippoflaps' )">
 <PRINT "$categoryset->ID2Radio( $categoryID,'category' )">
 </FORM>


ALTERNATES METHODS

The following methods allow the addition of alternate (languages) with a CategorySet.

Please note that the usefulness of Alternates has decreased significantly with the invention of sub-classes CategorySets with extra fields. It is therefore likely that the Alternates functionality will be removed in the future, and it should therefore not be used for new projects anymore.


AddAlternate

Add an alternative version of all current categories to the CategorySet. This is usually another language version of the names of all categories. This allows the same database structure to be used for each alternate (language) version of a database.

A CategorySet object can only handle one alternate version at the same time. If more than one alternate version of a category is needed, then a separate CategorySet object must be created for each alternate (language) version.

After the alternate (language) is added, the alternate (language) of the CategorySet object is also set to that alternate. To select an already existing alternate, use the SetAlternate method.

Input Parameters

 1 token for the alternate (language)
   (a unique string indicating the alternate, e.g. "deutsch")
 2 reference to a hash indicating names of categories (keyed on ID)
   (default: use same names as default)
 3 reference to a hash indicating sortnames of categories (keyed on ID)
   (default: use names as lowercase as default)
Output Parameters

 1 object itself if successful
Note

Please note that all categories will exist in all alternates (languages). This means that adding or deleting a category in one alternate (language) this will add or delete a category with the same ID in all the other alternates (languages).

Example

 $hn = new HN;
 $categoryset = $hn->CategorySet( 'technology' );
 $categoryset->AddAlternate( 'deutsch' );


SetAlternate

Set the alternate (language) to be used for the object, and all objects that are created from this object. To create an alternate (language), use the AddAlternate method.

Input Parameters

 1 token for the alternate (language)
   (a unique string indicating the alternate, e.g. "deutsch")
Output Parameters

 1 object itself if successful
Example

 $hn = new HN;
 $categoryset = $hn->CategorySet( 'technology' );
 $categoryset->SetAlternate( 'deutsch' );


OBJECT METHODS

The following methods allow changes to a single category in a CategorySet.


Category

Create a new Liz::CategorySet::Category object, either from existing information or for a new entry. For more documentation, see the Liz::CategorySet::Category object itself.

Input Parameters

 1 ID/name to created Category object with
   (default: none = new category)
 2 ID of parent category
   (default: 0 = top)
 3 sortname of category (name of which category should be sorted)
   (default: same as name if 1st parameter is name)
Output Parameters

 1 instantiated Category object
Example

 $hn = new HN;
 $categoryset = $hn->CategorySet( 'technology' );

 $category = $categoryset->Category;
 $category = $categoryset->Category( 'Toilet Seats' );
 $category = $categoryset->Category( $categoryID );


SIMILAR ID METHODS

The following methods are related to finding out (external) ID's that have one or more categories in common.

#----------------------------------------------------------


Categories2SimilarIDs

Returns a reference to a list of ID's that are similar to the specified category ID's and optionally return a reference to a hash containing the number of categories that matched.

Input Parameters

 1    table of which to return ID's only or ID to be skipped (table implicit from ID)
      (default: return all types of ID's)
 2    maximum number of ID's to be returned
      (default: unlimited)
 3    minimal number of matching categories (optional)
      (default: 1)
 4..N ID's of categories for which to find similar ID's
Output Parameters

 1    reference to list of ID's that are similar
 2    reference to hash with the number of categories matched, keyed to ID
Example

 ($similarID,$depth) =
  $emotion->Categories2SimilarIDs( Libris::Opus::RawTableName(),10,@selected );
 foreach( @{$similarID} ) {
   print "opusID = $_ ($$depth{$_})\n";
 }
Note

To prevent favouring certain ID's that are in the lowest bracket of number of matching ID's, this method will return all ID's found that have the lowest number of categories matched. This means that the maximum number of ID's returned may actually be exceeded.


Categories2SimilarIDsCacheClear

Clears the cache kept for requests to Categories2SimilarIDs and ID2SimilarIDs.


Explode

Pre-generate all possible permutations of categories of all external ID's so that searches with Categories2SimilarIDs and ID2SimilarIDs that have not been cached already, become much faster.

This method is usually run as a daily cron-job. To make sure it is only run when changes have been made, the last edit information of the associated categories is checked against the last time an Explode was done. If no changes were made, this method will return without doing anything.

If a new pre-generated set of permutations is made, then method Categories2SimilarIDsCacheClear is also called immediately to invalidate the cache.

Call method Implode to remove the extra tables and revert to the ``normal'' way of looking for ID's with similar categories.

Input Parameters

 1 flag: whether to force a complete re-explode
   (default: check last edited date)
Output Parameters

 1 whether a full explode was done
Example

 print "Explosion performed\n" if $categoryset->Explode;


Exploded

Returns a flag to indicate whether the methods ID2SimilarIDs and Categories2SimilarIDs use the Exploded table with pre-generated combinations or not.

Output Parameters

 1 flag: whether the Exploded table will be used
Example

 $exploded = $categoryset->Exploded;


ID2SimilarIDs

Returns a reference to a list of ID's that are similar to the specified ID and optionally return a reference to a hash containing the number of categories that matched.

Input Parameters

 1 ID for which to search similar ID's
   (default: ID of object)
 2 maximum number of ID's to be returned
   (default: unlimited)
 3 minimal number/fraction/percentage of matching categories
   (default: 1, N or 0.nnn or nn%)
 4 parentID of the category ID's to be used in searching only
   (default: all category ID's)
Output Parameters

 1 reference to list of ID's that are similar
 2 reference to hash with the number of categories matched, keyed to ID
 3 string of ID's and levels, seperated by :, joined by comma's (for caching purposes)
Example

 $similarID = $emotion->ID2SimilarIDs( $ID,10 );
Note

To prevent favouring certain ID's that are in the lowest bracket of number of matching ID's, this method will return all ID's found that have the lowest number of categories matched. This means that the maximum number of ID's returned may actually be exceeded.


Implode

Remove all pre-generated permutations generated by Explode.

Example

 $categoryset->Implode;


LIST METHODS

The following methods allow listing of information in the CategorySet.


List

Return an SQL statement handle for a list of categories. This list can be either from the top or of all categories immediately belonging to another category.

The following fields may be specified with the 2nd parameter:

 ID
 The ID of the category

 name
 The name of the category

 depth
 The relative "depth" (number of parents) of the category

 sortname
 The name with which this category is sorted

 created
 Timestamp value when this category was created

 updated
 Timestamp when the category was last updated

 options
 Options associated with the category

 parentID
 The ID of the parent of this category

 status
 The status of this category

 foreignkey
 The foreign key of this category

 data
 The extra data of this category
Input Parameters

 1 ordinal number or ID of category from which to commence listing
   (default: 0 = list only at the top)
 2 fields to return (comma delimited)
   (default: 'ID,name,depth,sortname,created,updated,options,parentID,status,foreignkey,data' )
 3 fieldname on which to order the result
   (default: 'sortname')
 4 extra condition to be applied
   (default: none)
Output Parameters

 1 SQL statement handle (on which method "fetchrow" can be applied)


AUTHORS

Elizabeth Mattijsen ( lizperl@INC.nl )

Contributions by:

- Ronald Lens ( ronald@xxLINK.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

Version 1.04, 7 March 2000

Fixed problem in new which would cause fields in subclassed versions to be ignored: the call to ExtraFields was missing.

Version 1.03, 25 November 1999

Put module name between quotes to fix obscure bug in Perl 5.005x under ModPerl in method CategorySet.

Version 1.02, 30 September 1999

Fixed problem in NameAlways2ParentIDFields: ``ID'' was being added to the field name when it shouldn't have been.

Now no longer adds Exporter to ISA: wasn't necessary.

Version 1.01, 20 September 1999

Method IDs2FrequencyHash added: calculate the frequencies in which categoryID's are linked to external ID's.

Version 1.00, 31 August 1999

Methods ID2Check, ID2Pulldown and ID2Radio now accept fully qualified variable names so that they can be called within sub-modules.

Version 0.99, 16 August 1999

Method new now uses Liz::SQL ``new'' to create object.

Class method categorysets now sub-classed from Liz::SQL ``sets''.

Version 0.98, 13 August 1999

Adapted method Categories2SimilarIDs (and indirectly ID2SimilarIDs to use the new Exploded tables when available.

Added new method Exploded to indicate whether the methods ID2SimilarIDs and Categories2IDs use the pre-generated combination tables created by Explode.

Added new method Implode, which removes the extra tables generated by Explode.

Added new method Explode which pre-generates all possible permutations of the categories associated with external ID's, so that ID2SimilarIDs and Categories2SimilarIDs can perform faster searches.

Version 0.97, 5 August 1999

Changed method Names2IDs so that it is now also possible to specify -1 for the parentID, indicating any parent ID for the given name(s).

Version 0.96, 24 July 1999

Fixed problem with NameAlways2ParentIDFields which would not append 'ID' to the field names.

Version 0.95, 20 July 1999

Fixed problem with new which would always return as if the table was just created.

Internal routine CreateTable now also returns whether the table was already existed.

Version 0.94, 12 July 1999

Made all the regular expressions m## and s### constant when possible, thus reducing CPU while increasing the memory footprint somewhat.

Version 0.93, 10 July 1999

Added method NameAlways2ParentIDFields for quickly setting a lot of parent ID's in an object.

Version 0.92, 9 July 1999

Changed method new so that the new Liz::SQL create method is used. This should reduce memory footprint and increase execution speed.

Removed check for InitID: this is not neccesary, as the Liz::SQL connect method already takes care of this.

Version 0.91, 8 July 1999

Added own method reset which now properly drops all necessary tables and takes care of all other references in standard tables.

Version 0.90, 23 June 1999

Changed usage of method ``Exists'' to method ``Count'' in method new which should be much faster in determining whether a table exists or not.

Version 0.89, 22 June 1999

Expanded the meaning of the third input parameter of ID2SimilarIDs to include fractional setting (e.g. 2/3) or percentage setting (e.g. 50%).

Added check to Categories2SimilarIDs so that incorrect number of categories to match (e.g. <0) are caught.

Version 0.88, 12 May 1999

Adapted typography of the source to the new indented format.

Method new now returns a flag to indicate whether the categoryset was just created, to facilitate subclassing with extra fields.

Version 0.87, 21 April 1999

Added support for data (blob): database upgrade was necessary.

Version 0.86, 7 April 1999

Added support for foreign keys: database upgrade was necessary.

Version 0.85, 16 January 1999

Improved method ParentID: now returns the different parentID's of a number of category ID's.

Version 0.84, 13 January 1999

Adapted method Categories2IDs so that an empty list of category ID's would no longer create an error, but instead return all ID's that have at least one category associated, possibly of a specific table.

Version 0.83, 8 January 1999

New method ParentID added: return the parentID of a given category ID.

Version 0.82, 7 January 1999

Method categorysets now also returns a reference to a hash with the database versions.

Fixed problem in categorysets that would prevent categorysets with the default identification from being listed.

Version 0.81, 29 December 1998

Fixed problem in method new that would cause an update to the database format to be performed when a new table was created.

Version 0.8, 22 December 1998

Method new now does automatic upgrades of tables when needed.

New method Categories2SimilarIDs added: find ID's that match more or less a set of category ID's.

New method Categories2SimilarIDsClearCache added: this is in fact the old ID2SimilarIDsClearCache, which is now removed. The old caching table will automatically be removed when the database is updated.

Method ID2SimilarIDs is now a frontend to Categories2SimilarIDs instead of a subroutine by itself.

Version 0.71, 16 December 1998

Support for internal subroutine RawTableName added.

Version 0.7, 15 December 1998

Support for caching ID2SimilarIDs requests added: a query will now first look in a seperate table for cached requests so that the entire database does not need to be searched over and over again.

New method ID2SimilarIDsCacheClear added: clears the cache of queries from ID2SimilarIDs.

Version 0.69, 13 December 1998

Method ID2SimilarIDs now returns all ID's that have the lowest number of categories matching. This prevents favouring specific ID's with the lowest number of categories matched.

Version 0.68, 9 December 1998

Method ID2SimilarIDs now only returns ID's of the same table of the original ID (which makes a lot more sense).

Method Categories2IDs now also allows the specification of the table to limit returned ID's to.

Version 0.67, 2 December 1998

New method IDCategoryListUpdated added: returns timestamps of when the category list of the specified ID was created or updated.

New method ID2SimilarIDs: returns a reference to list of ID's that share a number of categoryID's.

Version 0.66, 17 November 1998

Updated Names2IDs so that it returns the first name of the list of names in a scalar context (instead of the nonsensical number of elements passed to it).

Version 0.65, 15 November 1998

Updated method IDCategoryLists2IDs so that it is also possible to return/set names instead of ID's.

Version 0.64, 30 October 1998

New method CategorySetIDs added: set all the (external) ID's associated with a Category.

Fixed problem in IDDeleteCategoryList.

Version 0.63, 29 October 1998

Methods List, ID2Check, ID2Pulldown and ID2Radio now allow an extra SQL condition to be specified, instead of just a status value.

Version 0.62, 28 October 1998

Method IDCategoryLists2IDs now sets variables and lists in the callers namespaces if called with parent category names in a void context.

Version 0.61, 27 October 1998

Fixed several problems with regards to the new Alternates functionality.

Added parameter to indicate which field to order the result on to method List.

Version 0.6, 26 October 1998

Fixed problem in NameAlways2ID: the depth field was not being set if the category was not yet in the database.

Support for alternates (languages) added. This initially consists of the new methods AddAlternate and SetAlternate plus changes to several other routines.

Version 0.55, 10 October 1998

Added extra HTML field to ID2Pulldown.

Version 0.54, 6 October 1998

Reduced memory footprint by fully qualifying global variables and external subroutines.

Version 0.53, 18 September 1998

New method IDs2Names allows easy translation of a list of ID's to their associated names.

Version 0.52, 16 September 1998

New autoloaded method Token returns the token with which a categoryset was created.

Version 0.51, 13 September 1998

New method FillIDsInObject: allows easy translation of name fields stored in an object to be translated to their ID's and then stored in the object again.

New method FillNamesInObject: allows easy translation of ID fields stored in an object to be translated to their names and then stored in the object again.

Method NameAlways2ID now allows name of the parent category to be specified, instead of ID only.

Version 0.5, 10 September 1998

Methods Names2IDHash and Names2IDs now cache any category name to parentID translation in the object itself.

Method IDCategoryLists2IDs now allows names of the parent categories to be specified, instead of their ID's only.

Methods ID2Check, ID2Pulldown and ID2Radio now allow the name of a main category (with parent 0) to be specified. Parent ID now also defaults to previously used parent ID for the object.

Version 0.4, 7 September 1998

New method NameAlways2ID: always returns an ID for a category name, adds new category if it didn't exist yet.

Methods Names2IDHash and Names2IDs now allow specification of parent ID to which the categories should belong. This change makes these methods *INCOMPATIBLE* with previous versions of these methods.

Version 0.3, 6 September 1998

New method Categories2IDs added: return the IDs that are associated with the indicated categories.

New method IDCategoryLists2IDs added: return category ID's associated with an ID and a number of category parent ID's.

New method IDAddCategoryList added: add categories to the already existing categories associated with an ID.

New method IDDeleteCategoryList added: delete categories from the already existing categories associated with an ID.

New method IDGetCategoryList added: return categories associated with an ID.

New method IDSetCategoryList added: set the categories associated with an ID.

Support for generic ID2CategoryLIST translation added.

Version 0.2, 4 September 1998

Support for status field added.

Version 0.1, 24 August 1998

First version of this true Perl module.