/[Arh]/lib/Arh/Bootstrap.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /lib/Arh/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations)
Thu Nov 29 19:32:41 2007 UTC (11 years, 9 months ago) by dpavlin
File size: 2317 byte(s)
small tweaks, mostly visible because of *some* css :-)
1 use warnings;
2 use strict;
3
4 package Arh::Bootstrap;
5 use base qw(Jifty::Bootstrap);
6
7 use Data::Dump qw/dump/;
8
9 =head1 Bootstrap application data
10
11 Create initial data
12
13 =cut
14
15 sub run {
16 warn "## run",dump(@_);
17 my $self = shift;
18
19 my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );
20
21
22 my $u = Arh::Model::User->new(current_user => $system_user);
23
24 $u->create(
25 name => 'Admin',
26 lastname => 'User',
27 email => 'admin@example.com',
28 email_confirmed => 1,
29 password => 'password',
30 administrator => 1,
31 organization => 'Site administrator',
32 );
33
34 $u->create(
35 name => 'Anonymous',
36 lastname => 'User',
37 email => 'anonymous@example.com',
38 email_confirmed => 1,
39 password => 'password',
40 administrator => 0,
41 organization => 'Part of anonymous user crowd',
42 );
43
44 my $pt = Arh::Model::PictureType->new(current_user => $system_user);
45
46 $pt->create( name => $_ ) foreach ( qw/
47 tlocrt
48 slika
49 rekonstrukcija
50 aksiometrija
51 arhitektura
52 namještaj
53 / );
54
55 my $chronology = Arh::Model::Chronology->new(current_user => $system_user);
56 $chronology->create(
57 name => 'kraj 8. stoljeća',
58 year_from => 760,
59 year_to => 800,
60 );
61
62 my $material = Arh::Model::Material->new;
63 $material->create(
64 name => 'tvrdi vapnenac',
65 );
66
67 my $location = Arh::Model::Location->new;
68 $location->create(
69 name => 'Lapidarij u Balama',
70 );
71
72 my $place = Arh::Model::Place->new;
73 $place->create(
74 name => 'mjesto iskapanja',
75 );
76
77 my $campaign = Arh::Model::Campaign->new(current_user => $system_user);
78 $campaign->create(
79 place => $place,
80 name => 'prvo iskapanje',
81 date_from => '2007-11-28',
82 date_to => '2008-03-15',
83 );
84
85 my $unit = Arh::Model::Unit->new(current_user => $system_user);
86 $unit->create(
87 name => 'Mali kapitel stupića mnolitnog oltara',
88 number => 'SMV - 96/60',
89 campaign => $campaign,
90 dimensions => 'visina kapitola 13,5 cm; ukupna visina: 14,5 cm; presjek 13,5x13,5x5cm; manji presjek 11cm',
91 position => 'otkriveno cca 12m od istočne fasade crkve',
92 description => 'Ukrašen u doljnjem dijelu astragalom. U dobrom stanju. Abakus ukrašen na klasičan način, astragal u dva pojasa. Pojasnica sa spojenim listovima.',
93 chronology => $chronology,
94 location => $location,
95 );
96
97 my $um = Arh::Model::UnitMaterial->new;
98 $um->create(
99 unit => $unit,
100 material => $material,
101 );
102 }
103
104 1;

  ViewVC Help
Powered by ViewVC 1.1.26