Minivend-4.04 changes: * Demo: Fixed COLSPAN=0 in logo bars -- it was killing Gecko rendering. * Demo: fixed email password function * Makefile.PL adjusts for BSD MaxServers * Added README notes about BSD and MaxServers. * Config.pm: added AutoEnd to match Autoload * Interpolate.pm: fixed bug in shipping which prevented old-style geographic qualification from working -- thanks to Bob Jordan. * Order.pm: fixed multi-item order / mv_order_group problem * Session.pm: changed session retries to internal code. Thanks to Jim Balster. * UserDB.pm: added "load" function to complement "save". Thanks to Christopher Thompson. * Util.pm: changed Data::Dumper::Indent setting to localize * makecat now handles symlinked minivend.cfg * minivend executable: -- AutoEnd added -- adjusted path settings so that FinalPath can be set in Autoload -- Added ability to call GlobalSub as Autoload when matches /^\w+$/ -- cleaned up macro calls (remove redundant/unneeded defined checks) * doc updates -- thanks to Jeff Carnahan, Hans-Joachim Leidinger, and Bill Randle. * Fixed major problems in [sort ....], now works * Added vestigial Windows install Minivend-4.03 changes: * MiniMate now a part of Minivend * Fixed partial update problems with SQL databases * Fixed [time ...] tag. * Fixed OnFly ordering problem (Parse.pm). * Fixed initp.PL problem when using CPAN module installer (thanks to Jim Balster) * Added [if errors] You have errors. [/if] * Added tag reference to distribution -- it was there in Tagref.pm but now we build it * Added ability to not update order counter in Order.pm -- if Vend::Session->{mv_order_number} is used * fix [checked ...] tag to work and set default only if empty * fixed [timed-build] to work with $Vend::Session->{frames} * fixed _ca_postcode and _zip to actually work. * fixed $::Session reference (thanks Bill Randle!) * changed uneval to uneval_it in UserDB for more compact storage with no * added keep=1 parameter in set_hash to allow sort of a merge * fixed expire to work better with file-based sesssions * Makecat: -- fixed endless loop problem with --nocopy and bad directory spec -- added ~ processing to the appropriate directories. * Racke updated distribution so it works better with CVS * Fixed etc/log_transaction so auto-user updates are made, now allows you to keep track of customers * Documentation update to Minimate (recommended modules) * Frames fixes for Minimate * Stefan fixed compile_link to work with relocation (debian pkg build) * Jim Balster helped me find a race condition in SessionFile.pm, fixed * Added ability to set DEFAULT_TYPE for SQL type, replaces former hard-coded default of char(128) * Added history-scan tag Minivend-4.02 changes: * Report generator for Minimate, with MV support. * Additional Filter entries. * Updated "expire" and "expireall" to work with file-based sessions. * Fixed bugs in Internal HTTP server headers. * Fixed "Next" problem in [more-list]. Minivend-4.01 introduces the following: * Linux binaries will be tracked with all releases. The RPM spec files have been published, so it should be possible for users on other processors/operating systems to build binaries for those systems. Some things that are present in the Linux binary: -- Log files are kept in /var/log/minivend -- Demo catalogs are pre-built and placed in /var/lib/minivend/basic and /var/lib/minivend/simple. -- PID and socket files go in /var/run/minivend -- Main config file is /etc/minivend.cfg -- /etc/rc.d/init.d/minivend script added, adds starts for runlevels 3, 4, 5, stops for rest of the levels. -- /etc/logrotate.d/minivend log rotation added. MiniMate and minivend-docs RPMs are also provided. They are not relocatable yet, sorry. I think I may be able to figure that one out eventually.... * Bug in [query ...] and other tags fixed. It prevented [more-list] ... [/more-list] from working properly. * Bug in build procedure found, should prevent binaries and man pages ending up in strange places. Everything. Well, not completely -- many MiniVend 3.x catalogs can run with few changes, but there will be changes. W H A T ' S N E W Minivend-4.00 is the initial release version. MiniVend 4.x is a major rewrite that restructures many things. Major new features are almost too many to mention, read the documentation for the most complete description. Some highlights: * All lists are the same. The basic code for all lists is common, meaning that the days of [sql-param ...] and [item-param ...] being different are over. * All lists can have any prefix. This means that you can do: [loop prefix=item list="99-102 00-0011a"] [item-code] [item-field price] [/loop] or [loop prefix=color list="[item-accessories options, color"] [color-code] [color-data colors name] [/loop] * All databases can do basic SQL queries, even MiniVend ones. These three will/should work much the same on any MiniVend database type: [query sql="delete from inventory where code = '[item-code]'"] [/query] [query sql="insert into inventory ('[item-code]', '[value new_number]'"] [/query] [query sql="update inventory set qty = '[value new_number]' where code = '[item-code]'] [/query] [query sql="select * from products"] [/query] All lists can have a [more-list], can be limited by mv_matchlimit, etc. * You can save queries to a variable space and then call them in code: [query sql="select * from products" hashref=prod_table][/query] [perl] $products = $Query->{prod_table}; $mona_code = '00-0001'; foreach $ref (@$products) { $artist = $ref->{artist}, last if $ref->{code} eq $mona_code; } return "The Mona Lisa's artist is: " . $artist; [/perl] * All databases and session-variable setting/reading parameters have a powerful cascading filter capability. [data table=products col=artist key=00-341] returns: VAN GOGH, Vincent [data table=products col=artist key=00-341 filter="name namecase" ] returns: Vincent Van Gogh [data table=products col=artist_formatted key=00-341 filter="name namecase" value"VAN GOGH, Vincent" ] stores: Vincent Van Gogh The same thing works for [value ...], [cgi ...], etc. As well as for certain SQL query situations. * Many new configuration prodedure capabilities: - #ifdef and #ifndef on Variable values - #include files now included at point of entry instead of at end of process - attach subroutines to configuration settings with Tie::Watch - Set directives with code, also using Tie::Watch - Require directive ensures that GlobalSub and global UserTag entries are present when moving a catalog * A new ASP-style syntax is supported: This is HTML <% $Document->write('This is code'); %> HTML again. <% $Document->write('Code again.'); %> * A new Perl object set is consistent in all areas. [perl] $Document->write("Your name is $Values->{name}"); [/perl] and [calc] $Document->write("Your name is $Values->{name}"); [/calc] are the same, as is: ActionMap your_name <write("Your name is $Values->{name}"); return; } EOR Objects supported are: $CGI->{key} Hash reference to raw submitted values $CGI_array->{key} Hash reference to array submitted values %Db Hash of available database tables $DbSearch->method({}) Do searches in your code $Document->write() Writes to page $Carts->{cartname} Direct reference to shopping carts $Config->{key} Direct reference to $Vend::Cfg $Scratch->{key} Direct reference to scratch area $Session->{key} Direct reference to session area %SQL Hash of available DBI database handles $Tag->tagname(@args) Call a tag as a routine (UserTag too!) $Tag->tagname({ %args }) Call with hash-style naming too! $TextSearch->method({}) Do searches in your code $Values->{key} Direct reference to user form values &Log($msg) Log to the error log HTML $msg Synonym for $Document->write($msg) * The search engine has been extensively reworked. -- Word matching should be much more predictable -- You can do grouping of search specifications Glimpse is not yet integrated. * Tag parameters quoted with parameter=`code` are the equivalent of parameter="[calc]code[/calc]". They can be subroutine calls, too. * Tag parameters can be quoted with | to strip whitespace: [page href=| [value name="whatever"] |] is equivalent to [page href="[value name="whatever"]"] * Filters can be created with Filter directive and/or [input-filter name=var op="uc"][/input-filter] uc UPPER CASE lc lower case digits only digits word only A-Z a-z _ 0-9 urlencode space becomes %20 entities < becomes < strip strip leading/trailing whitespace no_white strip all whitespace gate set to blank unless scratch variable with same name is non-blank n (where n is an integer) length limit remove delete existing filter (if any) * Filter directive allows filtering of certain CGI variables for input conditioning; this is not session dependent and automatically operates on any iteration of the variable... Filter phone digits 10 That removes all non-digit values from the variable "phone", then limits length to 10. Any session-based filters are applied after this one. * [input-filter name=foo] CODE [/input-filter] Sets a routine passed to the equivalent of a "[calc]" tag. The value to be filtered is placed in the variable "$mv_filter_value", and the name is set to "$mv_filter_name". It is possible to do something like: [input-filter name=country tables=country] my $val = $mv_filter_value; my $prospect = &tag_data('country', 'name', $val); return $prospect || $val; [/input-filter] That will return the name of a country if it is found as a key in the database (assuming the simple demo country definitions). The tables=country directive is necessary to prepare the database for access this early in the process. * Major improvements in the parser, notably optimization when [pragma no_html_parse] and/or positional parameters are used. * ECML is supported via the Vend::ECML module. To map the checkout form values from MiniVend UserDB names, with an [ecml ...] tag: [ecml state] is equivalent to: * The [price] tag now supports pricing with attributes (size/color etc.). If you do [price code=99-102 size=XL color=RED] [price code=99-102 size=L color=RED] [price code=99-102 size=L color=BLUE] in the demo, this will demonstrate it. * The idiom: #include directory/* now is supported (and used in the demo minivend.cfg file). This includes all files in that directory (but not subdirectories) and allows you to include the whole directory. It should make maintaining multiple servers a bit easier. * Items can now be ordered "on-the-fly" in the standard distribution by adding mv_order_fly. * Added form-remap based on catalog script-name (too early for other methods). In minivend.cfg: FormRemap /cgi-bin/simple code mv_order_item FormRemap /cgi-bin/simple item mv_order_fly * Made some major changes in the demo. Notably, MySQL should install out of the box. * Makecat now strips quotes from Apache parameters read from httpd.conf file. * Added Tagref.pm module which can document the implementation of even UserTags. Add this to minivend.cfg to print one to a MiniVend page: UserTag tag-reference Routine <mv_tagref.pod"); my $reference = Vend::Tagref::tag_reference(); print TAGREF $reference; close TAGREF; my $out = `pod2html mv_tagref.pod`; if(! $out) { $Vend::StatusLine = "Content-Type: text/plain\r\n"; $out = $reference; } return $out; } EOR * Removed all dependencies on ProductsFiles containing 'products'. * Complete internationalization of error messages via Locale, sample locale.error file included. * Added Legacy directive to minivend.cfg to support older catalogs that don't define "products" database. * Catalog directive can now be specfied as: Catalog simple Catalog simple dir /home/minivend/simple Catalog simple script /cgi-bin/simple Catalog simple alias /secure-bin/simple Catalog simple alias /simple Most importantly, certain global directives can be set on a catalog basis: Catalog simple directive ErrorFile /var/log/minivend/simple.log * The [more-list] tag now accepts a [decade-next][/decade-next] and [decade-prev][/decade-prev] setting to break match lists into groups of 10 pages. Alternatively, the search setting mv_more_decade can be set true (two-letter equivalent is md=1) then you need not provide the [decade-next] tag. Actually "decade" is a tad deceiving, for if mv_more_decade (or md=) is set to an integer greater than 1, that is the number of pages that will be grouped. =head2 AutoModifier Sets an attribute in a shopping cart entry to the field of the same name in the ProductsFile pertaining to this item. This is useful when doing shipping calculations or other embedded Perl that is based on item attributes. To set whether an item is defined as "heavy" and requires truck shipment, you can do: AutoModifier heavy When an item is added to the shopping cart using MiniVend's routines, the C attribute will be set to the value of the C field in the products database. In the default demo that would be C; any changes to C would affect that, of course. * Syslog error logging (global only) is supported via the global SysLog directive. Syslog command /usr/bin/logger Syslog tag mv1 Syslog alert local3.warn Syslog warn local3.info Syslog info local3.info This would cause global errors to be logged with the command: /usr/bin/logger -t mv1 -p local3.alert and cause system log entries something like: Oct 26 17:30:11 bill mv1: Config 'co' at server startup Oct 26 17:30:11 bill mv1: Config 'homefn' at server startup Oct 26 17:30:11 bill mv1: Config 'simple' at server startup Oct 26 17:30:11 bill mv1: Config 'test' at server startup Oct 26 17:30:13 bill mv1: START server (2345) (INET and UNIX) This facility is alpha and is subject to change. Of course you can wrap your own wrapper around it to get it to behave how you want. * Added Scratch variable mv_data_enable to gate the update_data function; prior to this it was possible to update a database willy-nilly. * Many bug fixes, of course. Notably [and ...] and [or ..] were broken in some cases. * "Message" directive allows you to display messages at startup, both global and catalog. REMOVAL Many things were removed as redundant, deprecated, or just plain crufty: * All frame features removed, frames are managed by the user in HTML. * Tags removed: buttonbar Replace with Variable. random Replace with [ad random=1] or custom code rotate Replace with [ad ...] help No replacement body Replace with templates finish_order No replacement last_page No replacement item-link No replacement, just use [page [item-code]] loop-link No replacement, just use [page [loop-code]] sql-link No replacement, just use [page [sql-code]] accessories Replace with normal data functions * Compatibility routines for many popular tags like [random], [rotate], etc. are provided in the compat/ directory. To use, include the files in minivend.cfg: #include compat/* * Directives removed: ActionMap AdminDatabase AdminPage AsciiBackend BackendOrder ButtonBars CheckoutFrame CheckoutPage CollectData DataDir Delimiter DescriptionTrim FieldDelimiter FrameFlyPage FrameLinkDir FrameOrderPage FrameSearchPage ItemLinkDir ItemLinkValue MsqlDB MsqlProducts Mv_AlinkColor Mv_Background Mv_BgColor Mv_LinkColor Mv_TextColor Mv_VlinkColor NewReport NewTags OldShipping OrderFrame PageCache PriceDatabase Random ReceiptPage RecordDelimiter ReportIgnore Rotate SearchFrame SearchOverMsg SecureOrderMsg SpecialFile SubArgs Tracking * Minor operations removed: - auto-substitution of mp= on [loop search=profile], [search-region arg=profile] - [tag scan]... - [tag sql]... Many of these are related to one of: * Removal of frames logic * Removed tags * Obsolete methods * Old routines for 2.0x compatibility ---------------------------- UPGRADING from MiniVend 3 Form Data updates: * Added Scratch variable mv_data_enable to gate the update_data function; prior to this it was possible to update a database willy-nilly. Do: [set update_database] [if type=data term="userdb::trusted::[data session username]"] [set mv_data_enable]1[/set] [else] [set mv_data_enable]0[/set] [/else] [/if] [/set]