This repository has been archived by the owner on Dec 19, 2023. It is now read-only.
/
WHATSNEW
501 lines (379 loc) · 15.3 KB
/
WHATSNEW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
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:
<HTML MV=mvasp><BODY>This is HTML</BODY>
<%
$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 <<EOR
sub {
$Document->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:
<INPUT TYPE=text
VALUE="[value state]"
NAME=Ecom_ShipTo_Postal_StateProv
SIZE=2>
* 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 <<EOR
sub {
require Vend::Tagref;
open (TAGREF, ">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<heavy> attribute will be set to the value of the C<heavy> field in
the products database. In the default demo that would be C<products>; any
changes to C<ProductFiles> 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]
<INPUT TYPE=hidden NAME=mv_click VALUE=update_database>