]> git.imager.perl.org - bse.git/blame - site/util/initial.pl
save the product tier on ordering
[bse.git] / site / util / initial.pl
CommitLineData
030a55be
TC
1#!/usr/bin/perl -w
2# Builds an initial database
3# make sure you set the appropriate values in cgi-bin/modules/Constants.pm
4
5use strict;
6use lib '../cgi-bin/modules';
7use DBI;
e0ed81d7 8use BSE::TB::Article;
4ef01459 9use Constants qw($DSN $UN $PW $CGI_URI $SHOP_URI $ROOT_URI);
d2473dc2 10use BSE::API qw(bse_init bse_cfg);
12b42a0b 11use BSE::Util::SQL qw(now_sqldate now_sqldatetime);
4ef01459 12
d2473dc2
TC
13bse_init("../cgi-bin");
14my $cfg = bse_cfg();
4ef01459 15my $securlbase = $cfg->entryVar('site', 'secureurl');
12b42a0b
TC
16my $nowDate = now_sqldate();
17my $nowDatetime = now_sqldatetime();
030a55be
TC
18
19my @prebuilt =
20 (
21 # the section that represent's the index page
22 {
23 id=>1,
24 parentid=>-1,
25 displayOrder=>100, # doesn't matter
26 title=>"My site's title",
3fc6a108 27 titleImage=>'',
030a55be
TC
28 body=>'',
29 imagePos=>'tr',
12b42a0b 30 release=>"$nowDate 00:00:00",
030a55be 31 expire=>'9999-12-31 23:59:59',
12b42a0b 32 lastModified=>"$nowDatetime",
030a55be
TC
33 keyword=>'',
34 template=>'index.tmpl',
bb27c670 35 link=>$ROOT_URI . '',
030a55be
TC
36 admin=>$CGI_URI.'/admin/admin.pl?id=1',
37 threshold=>10000, # needs to be high
38 summaryLength => 1000, # should be ignored
39e87dbd 39 generator=>'BSE::Generate::Article',
030a55be
TC
40 thumbImage=>'',
41 thumbWidth=>0,
42 thumbHeight=>0,
43 level=>1,
0d8debf1 44 listed=>1,
918735d1 45 flags=>'',
12b42a0b
TC
46 lastModifiedBy=>'system',
47 created=>"$nowDatetime",
48 createdBy=>'system',
9604a90c
TC
49 author=>'',
50 pageTitle=>'',
efcc5a30
TC
51 force_dynamic => 0,
52 cached_dynamic => 0,
53 inherit_siteuser_rights => 1,
12bcb7ac
TC
54 metaDescription=>'',
55 metaKeywords=>'',
70789617 56 summary => '',
0a66f55c 57 menu => 0,
37726cc9 58 titleAlias => '',
dbfbfb12 59 category => '',
030a55be
TC
60 },
61 {
62 # the invisible subsection for what's hot
63 id=>2,
64 parentid=>1,
65 displayOrder=>100, # doesn't matter
66 title=>"[index subsection]",
67 titleImage=>'',
68 body=>'',
69 imagePos=>'tr',
12b42a0b 70 release=>"$nowDate 00:00:00",
030a55be 71 expire=>'9999-12-31 23:59:59',
12b42a0b 72 lastModified=>"$nowDatetime",
030a55be
TC
73 keyword=>'',
74 template=>'index2.tmpl',
75 link=>'',
76 admin=>$CGI_URI.'/admin/admin.pl?id=1',
77 threshold=>10000, # needs to be high
78 summaryLength => 1000, # should be ignored
39e87dbd 79 generator=>'BSE::Generate::Article',
030a55be
TC
80 thumbImage=>'',
81 thumbWidth=>0,
82 thumbHeight=>0,
83 level=>2,
84 listed=>2,
918735d1 85 flags=>'',
12b42a0b
TC
86 lastModifiedBy=>'system',
87 created=>"$nowDatetime",
88 createdBy=>'system',
9604a90c
TC
89 author=>'',
90 pageTitle=>'',
efcc5a30
TC
91 force_dynamic => 0,
92 cached_dynamic => 0,
93 inherit_siteuser_rights => 1,
12bcb7ac
TC
94 metaDescription=>'',
95 metaKeywords=>'',
70789617 96 summary => '',
0a66f55c 97 menu => 0,
37726cc9 98 titleAlias => '',
dbfbfb12 99 category => '',
030a55be
TC
100 },
101 {
102 id=>3,
103 parentid=>-1,
104 displayOrder=>10000,
105 title=>'The Shop',
3fc6a108 106 titleImage=>'',
030a55be
TC
107 body=>'You can buy things here',
108 imagePos=>'tr',
12b42a0b 109 release=>"$nowDate 00:00:00",
030a55be 110 expire=>'9999-12-31 23:59:59',
12b42a0b 111 lastModified=>"$nowDatetime",
030a55be
TC
112 keyword=>'shop',
113 template=>'shop_sect.tmpl',
bb27c670 114 link=>$securlbase.$SHOP_URI.'/',
030a55be
TC
115 admin=>$CGI_URI.'/admin/admin.pl?id=3',
116 threshold=>1000, # ignored
117 summaryLength=>1000, # ignored
39e87dbd 118 generator=>'BSE::Generate::Article',
030a55be
TC
119 thumbImage=>'',
120 thumbWidth=>0,
121 thumbHeight=>0,
122 level=>1,
123 listed=>1,
918735d1 124 flags=>'',
12b42a0b
TC
125 lastModifiedBy=>'system',
126 created=>"$nowDatetime",
127 createdBy=>'system',
9604a90c
TC
128 author=>'',
129 pageTitle=>'',
efcc5a30
TC
130 force_dynamic => 0,
131 cached_dynamic => 0,
132 inherit_siteuser_rights => 1,
12bcb7ac
TC
133 metaDescription=>'',
134 metaKeywords=>'',
70789617 135 summary => '',
0a66f55c 136 menu => 0,
37726cc9 137 titleAlias => '',
dbfbfb12 138 category => '',
030a55be
TC
139 },
140 {
141 id=>4,
142 parentid=>3,
143 displayOrder=>10000,
144 title=>'[shop subsection]',
145 titleImage=>'',
146 body=>'', # don't set this - set the shop body instead
147 imagePos=>'tr',
12b42a0b 148 release=>"$nowDate 00:00:00",
030a55be 149 expire=>'9999-12-31 23:59:59',
12b42a0b 150 lastModified=>"$nowDatetime",
030a55be
TC
151 keyword=>'',
152 template=>'catalog.tmpl',
153 link=>'',
154 admin=>$CGI_URI.'/admin/shopadmin.pl',
155 threshold=>1000, # ignored
156 summaryLength=>1000, #ignored
46541e94 157 generator=>'BSE::Generate::Catalog',
030a55be
TC
158 thumbImage=>'',
159 thumbWidth=>0,
160 thumbHeight=>0,
161 level=>2,
162 listed=>2,
918735d1 163 flags=>'',
12b42a0b
TC
164 lastModifiedBy=>'system',
165 created=>"$nowDatetime",
166 createdBy=>'system',
9604a90c
TC
167 author=>'',
168 pageTitle=>'',
efcc5a30
TC
169 force_dynamic => 0,
170 cached_dynamic => 0,
171 inherit_siteuser_rights => 1,
12bcb7ac
TC
172 metaDescription=>'',
173 metaKeywords=>'',
70789617 174 summary => '',
0a66f55c 175 menu => 0,
37726cc9 176 titleAlias => '',
dbfbfb12 177 category => '',
030a55be 178 },
0629d909
TC
179 {
180 id=>5,
181 parentid=>1,
182 displayOrder=>10000,
183 title=>'[sidebar subsection]',
184 titleImage=>'',
185 body=>'', # don't set this
186 imagePos=>'tr',
12b42a0b 187 release=>"$nowDate 00:00:00",
0629d909 188 expire=>'9999-12-31 23:59:59',
12b42a0b 189 lastModified=>"$nowDatetime",
0629d909 190 keyword=>'',
3fc6a108 191 template=>'common/sidebar_section.tmpl',
0629d909 192 link=>'',
99ef7979 193 admin=>$CGI_URI.'/admin/admin.pl?id=5',
0629d909
TC
194 threshold=>1000, # ignored
195 summaryLength=>1000, #ignored
39e87dbd 196 generator=>'BSE::Generate::Article',
0629d909
TC
197 thumbImage=>'',
198 thumbWidth=>0,
199 thumbHeight=>0,
200 level=>2,
201 listed=>0,
918735d1 202 flags=>'',
12b42a0b
TC
203 lastModifiedBy=>'system',
204 created=>"$nowDatetime",
205 createdBy=>'system',
9604a90c
TC
206 author=>'',
207 pageTitle=>'',
efcc5a30
TC
208 force_dynamic => 0,
209 cached_dynamic => 0,
210 inherit_siteuser_rights => 1,
12bcb7ac
TC
211 metaDescription=>'',
212 metaKeywords=>'',
70789617 213 summary => '',
0a66f55c 214 menu => 0,
37726cc9 215 titleAlias => '',
dbfbfb12 216 category => '',
0629d909
TC
217 },
218 {
219 id=>6,
220 parentid=>2,
221 displayOrder=>10000,
222 title=>'[formatting guide]',
223 titleImage=>'',
3fc6a108 224 body=><<'EOS',
0629d909 225anchor[basic] b[Sample basic formatting:]
aae01097 226indent[link[/a/1.html|regular link text]
0629d909 227
aae01097 228b[link[/a/1.html|bold link text]]
0629d909 229
aae01097 230i[link[/a/1.html|italic link text]]
0629d909 231
aae01097 232i[b[link[/a/1.html|bold italic link text]]]
0629d909 233
aae01097 234link[http://www.google.com|link to external web site]
0629d909
TC
235]
236
237align[center|Align center text (NB: American spelling)]
238
239align[right|Align right text]
240
aae01097 241This is how you can make an email link: link[mailto:adriann@devbox.org|email us here!]
0629d909 242
aae01097 243hrcolor[100%|1|#CCCCFF] anchor[font]
0629d909 244b[Sample font sizing:] (use numbers 1 - 7 only)
aae01097 245indent[fontcolor[7|#FFCC33|This is font size 7 and colour]
0629d909
TC
246
247font[6|This is font size 6]
248
249font[5|This is font size 5]
250
251font[4|This is font size 4]
252
253font[3|This is font size 3]
254
255font[2|This is font size 2]
256
257font[1|This is font size 1]
258
aae01097 259(but they can be plus or minus numbers too)
0629d909 260
aae01097 261font[+2|This is font size +2]
0629d909 262
aae01097 263font[+3|This is font size +3]
0629d909 264
aae01097 265font[-2|This is font size -2]
0629d909 266
aae01097 267font[-3|This is font size -3]
0629d909
TC
268]
269
aae01097 270b[HINT:] The default font size for your body text is size 2 and the headings are size 4 Bold.
0629d909 271
aae01097 272hrcolor[100%|1|#CCCCFF] anchor[indent]
0629d909
TC
273b[Sample indenting and bullet points:]
274indent[This is a simple indent and bullet list
275** Add a bullet point to this line
276** Hit enter and type another
277** And now one final bullet
278
279## And this is a numbered list
280## It's very easy to format lists now
281## Now we can count to three]
282
aae01097
TC
283hrcolor[100%|1|#CCCCFF]
284b[The BSE colours:]
0629d909 285indent[
aae01097
TC
286table[bgcolor=#999999 width=170 cellpadding=1 cellspacing=0 |table[bgcolor=#FFFFCC width=100% cellspacing=0 cellpadding=5
287|fontcolor[2|#000000|Background - #FFFFCC]
288]]
289table[bgcolor=#FFFF99 width=170 cellpadding=5
290|fontcolor[2|#000000|Navbar - #FFFF99]
0629d909 291]
aae01097
TC
292table[bgcolor=#FFCC33 width=170 cellpadding=5
293|fontcolor[2|#000000|Sidebar Title - #FFCC33]
0629d909 294]
aae01097
TC
295table[bgcolor=#CCCCFF width=170 cellpadding=5
296|fontcolor[2|#000000|Title Panel - #CCCCFF]
0629d909 297]
aae01097
TC
298table[bgcolor=#333399 width=170 cellpadding=5
299|fontcolor[2|#ffffff|Crumb Panel - #333399]
300]
301table[bgcolor=#999999 width=170 cellpadding=5
302|fontcolor[2|#000000|Outlines - #999999]
303]
304table[bgcolor=#FFFFFF width=170 cellpadding=5
305|fontcolor[2|#000000|Item Panel - #FFFFFF]
0629d909
TC
306]
307]
aae01097 308hrcolor[100%|1|#CCCCFF]
0629d909
TC
309b[Sample links to an anchor:]
310indent[link[#basic|Jump to "Sample basic formatting"]
311link[#font|Jump to "Sample font sizing"]
aae01097 312link[#indent|Jump to "Sample indenting and bullet points"]
0629d909
TC
313link[#table|Jump to "Making a table"]]
314
315
aae01097 316hrcolor[100%|1|#CCCCFF] anchor[table]
0629d909
TC
317b[Making a table:]
318indent[
319BSE has special tags to create simple tables, but if you wish to do anything more complicated, we recommend you develop the table in HTML and insert the raw HTML into the body text field.
320
321table[
322|a very|simple
323|table|with 4 cells
324]
325
aae01097
TC
326table[bgcolor=#CCCCFF width=90% cellpadding=5
327|align[center|link[/a/1.html|this one]]|is
0629d909
TC
328|not so|simple
329]
330
331
332table[width=100% cellpadding=5
333|b[font[2|Project Management]]|font[2|Project management services for buildings, infrastructure, technology and environment, relocations.]
334|b[font[2|Events]]|font[2|Event marketing and management, overlay works, venue management.]
335|b[font[2|Property]]|font[2|Property development management and advisory.]
336|b[font[2|Management Consulting]]|font[2|Business improvement, change management, market testing, outsourcing, contracts and relationships, industrial relations, safety, asset management.]
337|b[font[2|Quality Assurance]]|font[2|Independent 3rd party audits, quality systems, certification, OHS&R programmes.]
338]
339]
340
aae01097
TC
341hrcolor[100%|1|#CCCCFF]
342
343b[Inserting a plain HTML table:]
344
345Use an HTML editor to create table like this, then paste the generated HTML code into the text body area as you would any normal text.
346
347html[
348<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
349 <tr>
350 <td>
351 <table width="100%" border="0" cellpadding="5" cellspacing="1">
352 <tr bgcolor="#FFCC33">
353 <td width="25%" height="18"> <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">PROJECT
354 MANAGEMENT</font></b></td>
355 <td width="25%" height="18"> <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">MANAGEMENT
356 CONSULTING</font></b></td>
357 <td width="25%" height="18"> <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">PROPERTY</font></b></td>
358 <td width="25%" height="18"> <b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">EVENTS</font></b></td>
359 </tr>
360 <tr valign="top" bgcolor="#FFFFCC">
361 <td width="25%">
362 <ul>
363 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
364 Project assessment and initiation</font></li>
365 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Project
366 audit</font></li>
367 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Distressed
368 project recovery</font></li>
369 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Construction
370 advisory</font></li>
371 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Relocation
372 management </font></li>
373 </ul>
374 </td>
375 <td width="25%">
376 <ul>
377 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Business
378 improvement </font></li>
379 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Change
380 management</font></li>
381 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Market
382 testing and Outsourcing</font></li>
383 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Information
384 management</font></li>
385 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Employee
386 relations</font></li>
387 </ul>
388 </td>
389 <td width="25%">
390 <ul>
391 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Development
392 management and packaging</font></li>
393 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Property
394 asset strategy</font></li>
395 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Property
396 advisory</font></li>
397 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Property
398 workout</font></li>
399 </ul>
400 </td>
401 <td width="25%">
402 <ul>
403 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Event
404 management</font></li>
405 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Sponsorship
406 and marketing</font></li>
407 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Event
408 overlay works</font></li>
409 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Venue
410 management</font></li>
411 <li><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Special
412 event consulting </font></li>
413 </ul>
414 </td>
415 </tr>
416 <tr valign="top" bgcolor="#003366 ">
417 <td colspan="4" bgcolor="#CCCCFF"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">This
418 could be a subtitle</font></b> </td>
419 </tr>
420 <tr valign="top" bgcolor="#FFFFCC">
421 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Contract
422 and commercial </font></td>
423 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Asset
424 management </font></td>
425 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Project
426 Marketing</font><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
427 Contract </font></td>
428 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Sponsorship</font></td>
429 </tr>
430 <tr valign="top" bgcolor="#FFFFCC">
431 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Project
432 information systems</font></td>
433 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Risk
434 management</font></td>
435 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Project
436 Marketing</font></td>
437 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Event
438 management</font></td>
439 </tr>
440 <tr valign="top" bgcolor="#FFFFCC">
441 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Independent
442 certification</font></td>
443 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Business
444 advisory</font></td>
445 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Feasibility
446 financial modelling</font></td>
447 <td width="25%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Event
448 overlay works</font></td>
449 </tr>
450 </table>
451 </td>
452 </tr>
453</table>]
0629d909
TC
454EOS
455 imagePos=>'tr',
12b42a0b 456 release=>"$nowDate 00:00:00",
0629d909 457 expire=>'9999-12-31 23:59:59',
12b42a0b 458 lastModified=>"$nowDatetime",
0629d909 459 keyword=>'',
99ef7979 460 template=>'common/default.tmpl',
86e178e9 461 link=>'/a/format_guide.html',
99ef7979 462 admin=>$CGI_URI.'/admin/admin.pl?id=6',
0629d909
TC
463 threshold=>1000, # ignored
464 summaryLength=>1000, #ignored
39e87dbd 465 generator=>'BSE::Generate::Article',
0629d909
TC
466 thumbImage=>'',
467 thumbWidth=>0,
468 thumbHeight=>0,
86e178e9
TC
469 level=>3,
470 listed=>0,
918735d1 471 flags=>'',
12b42a0b
TC
472 lastModifiedBy=>'system',
473 created=>"$nowDatetime",
474 createdBy=>'system',
9604a90c
TC
475 author=>'',
476 pageTitle=>'',
efcc5a30
TC
477 force_dynamic => 0,
478 cached_dynamic => 0,
479 inherit_siteuser_rights => 1,
12bcb7ac
TC
480 metaDescription=>'',
481 metaKeywords=>'',
70789617 482 summary => '',
0a66f55c 483 menu => 0,
37726cc9 484 titleAlias => '',
dbfbfb12 485 category => '',
86e178e9
TC
486 },
487 {
488 id=>7,
489 parentid=>2,
99ef7979 490 displayOrder=>20000,
86e178e9
TC
491 title=>'[rss generation]',
492 titleImage=>'',
493 body=><<'EOS',
494This body text is not used.
495
496This article generates RSS as used by some sites.
497EOS
498 imagePos=>'tr',
12b42a0b 499 release=>"$nowDate 00:00:00",
86e178e9 500 expire=>'9999-12-31 23:59:59',
12b42a0b 501 lastModified=>"$nowDatetime",
86e178e9
TC
502 keyword=>'',
503 template=>'common/rssbase.tmpl',
504 link=>'/a/site.rdf',
99ef7979 505 admin=>$CGI_URI.'/admin/admin.pl?id=7',
86e178e9
TC
506 threshold=>1000, # ignored
507 summaryLength=>1000, #ignored
39e87dbd 508 generator=>'BSE::Generate::Article',
86e178e9
TC
509 thumbImage=>'',
510 thumbWidth=>0,
511 thumbHeight=>0,
512 level=>3,
0629d909 513 listed=>0,
918735d1 514 flags=>'',
12b42a0b
TC
515 lastModifiedBy=>'system',
516 created=>"$nowDatetime",
517 createdBy=>'system',
9604a90c
TC
518 author=>'',
519 pageTitle=>'',
efcc5a30
TC
520 force_dynamic => 0,
521 cached_dynamic => 0,
522 inherit_siteuser_rights => 1,
12bcb7ac
TC
523 metaDescription=>'',
524 metaKeywords=>'',
70789617 525 summary => '',
0a66f55c 526 menu => 0,
37726cc9 527 titleAlias => '',
dbfbfb12 528 category => '',
0629d909 529 },
721cd24c
TC
530 {
531 id=>8,
532 parentid=>5,
533 displayOrder=>20000,
534 title=>'[sidebar logon]',
535 titleImage=>'',
536 body=><<'EOS',
537This body text is not used.
538
539This article puts a registration/login bar in the sidebar
540EOS
541 imagePos=>'tr',
12b42a0b 542 release=>"$nowDate 00:00:00",
721cd24c 543 expire=>'9999-12-31 23:59:59',
12b42a0b 544 lastModified=>"$nowDatetime",
721cd24c
TC
545 keyword=>'',
546 template=>'sidebar/logon.tmpl',
547 link=>'',
548 admin=>$CGI_URI.'/admin/admin.pl?id=8',
549 threshold=>1000, # ignored
550 summaryLength=>1000, #ignored
39e87dbd 551 generator=>'BSE::Generate::Article',
721cd24c
TC
552 thumbImage=>'',
553 thumbWidth=>0,
554 thumbHeight=>0,
555 level=>3,
556 listed=>1,
918735d1 557 flags=>'',
12b42a0b
TC
558 lastModifiedBy=>'system',
559 created=>"$nowDatetime",
560 createdBy=>'system',
9604a90c
TC
561 author=>'',
562 pageTitle=>'',
efcc5a30
TC
563 force_dynamic => 0,
564 cached_dynamic => 0,
565 inherit_siteuser_rights => 1,
12bcb7ac
TC
566 metaDescription=>'',
567 metaKeywords=>'',
70789617 568 summary => '',
0a66f55c 569 menu => 0,
37726cc9 570 titleAlias => '',
dbfbfb12 571 category => '',
721cd24c 572 },
030a55be
TC
573 );
574
d2473dc2 575my $dbh = BSE::DB->single->dbh
030a55be 576 or die "Cannot connect to database: ",DBI->errstr;
e0ed81d7 577my @columns = BSE::TB::Article->columns;
030a55be
TC
578$dbh->do('delete from article')
579 or die "Cannot delete articles: ",$dbh->errstr;
580$dbh->do('delete from product')
581 or die "Cannot delete from product: ", $dbh->errstr;
582$dbh->do('delete from image')
583 or die "delete from image: ",$dbh->errstr;
584my $sql = 'insert into article values('.join(',', ('?') x @columns).')';
585my $sth = $dbh->prepare($sql)
586 or die "Cannot prepare $sql: ",$dbh->errstr;
587for my $art (@prebuilt) {
ad74727d 588 defined $art->{linkAlias} or $art->{linkAlias} = '';
030a55be
TC
589 $sth->execute(@$art{@columns})
590 or die "Cannot insert row into article: ",$sth->errstr;
591}
592$dbh->disconnect();