/[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

Diff of /lib/Arh/Bootstrap.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by dpavlin, Thu Nov 29 19:32:41 2007 UTC revision 41 by dpavlin, Sun Apr 6 12:04:13 2008 UTC
# Line 13  Create initial data Line 13  Create initial data
13  =cut  =cut
14    
15  sub run {  sub run {
16          warn "## run",dump(@_);          #warn "## run",dump(@_);
17      my $self = shift;      my $self = shift;
18    
19          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );
# Line 29  sub run { Line 29  sub run {
29                  password => 'password',                  password => 'password',
30                  administrator => 1,                  administrator => 1,
31                  organization => 'Site administrator',                  organization => 'Site administrator',
32                    editing => 1,
33          );          );
34    
35          $u->create(          $u->create(
# Line 52  arhitektura Line 53  arhitektura
53  namještaj  namještaj
54  / );  / );
55    
56          my $chronology = Arh::Model::Chronology->new(current_user => $system_user);          my $chronology_8 = Arh::Model::Chronology->new(current_user => $system_user);
57          $chronology->create(          $chronology_8->create(
58                    name => '8. stoljeće',
59                    year_from => 701,
60                    year_to => 800,
61            );
62            my $chronology_end8 = Arh::Model::Chronology->new(current_user => $system_user);
63            $chronology_end8->create(
64                  name => 'kraj 8. stoljeća',                  name => 'kraj 8. stoljeća',
65                  year_from => 760,                  year_from => 760,
66                  year_to => 800,                  year_to => 800,
67                    part_of => $chronology_8,
68          );          );
69    
70    
71          my $material = Arh::Model::Material->new;          my $material = Arh::Model::Material->new;
72          $material->create(          $material->create(
73                  name => 'tvrdi vapnenac',                  name => 'tvrdi vapnenac',
74          );          );
75    
76            my $material2 = Arh::Model::Material->new;
77            $material2->create(
78                    name => 'nepoznato',
79            );
80    
81          my $location = Arh::Model::Location->new;          my $location = Arh::Model::Location->new;
82          $location->create(          $location->create(
83                  name => 'Lapidarij u Balama',                  name => 'Lapidarij u Balama',
# Line 74  namještaj Line 88  namještaj
88                  name => 'mjesto iskapanja',                  name => 'mjesto iskapanja',
89          );          );
90    
91    
92          my $campaign = Arh::Model::Campaign->new(current_user => $system_user);          my $campaign = Arh::Model::Campaign->new(current_user => $system_user);
93          $campaign->create(          $campaign->create(
94                  place => $place,                  place => $place,
# Line 82  namještaj Line 97  namještaj
97                  date_to => '2008-03-15',                  date_to => '2008-03-15',
98          );          );
99    
100    =for later
101          my $unit = Arh::Model::Unit->new(current_user => $system_user);          my $unit = Arh::Model::Unit->new(current_user => $system_user);
102          $unit->create(          $unit->create(
103                  name => 'Mali kapitel stupića mnolitnog oltara',                  name => 'Mali kapitel stupića mnolitnog oltara',
104                  number => 'SMV - 96/60',                  inventory_nr => 'SMV - 96/60',
105                  campaign => $campaign,  #               campaign => $campaign,
106                  dimensions => 'visina kapitola 13,5 cm; ukupna visina: 14,5 cm; presjek 13,5x13,5x5cm; manji presjek 11cm',                  dimensions => 'visina kapitola 13,5 cm; ukupna visina: 14,5 cm; presjek 13,5x13,5x5cm; manji presjek 11cm',
107                  position => 'otkriveno cca 12m od istočne fasade crkve',                  discovered_at => 'otkriveno cca 12m od istočne fasade crkve',
108                  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.',                  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.',
109                  chronology => $chronology,                  chronology => $chronology_end8,
110                  location => $location,                  location => $location,
111          );          );
112    
# Line 99  namještaj Line 115  namještaj
115                  unit => $unit,                  unit => $unit,
116                  material => $material,                  material => $material,
117          );          );
118            $um->create(
119                    unit => $unit,
120                    material => $material2,
121            );
122    
123            $unit->create(
124                    name => 'Staklo',
125                    inventory_nr => 'SMV - 42/60',
126                    campaign => $campaign,
127                    chronology => $chronology_8,
128                    location => $location,
129            );
130    
131            $um->create(
132                    unit => $unit,
133                    material => $material2,
134            );
135    
136    =cut
137    
138            my $cat = Arh::Model::Category->new;
139            $cat->create( name => $_ ) foreach ( qw/arhitektura skulptura slikarstvo liturgijske instalacije epigrafija metal/ );
140    
141            my $site = Arh::Model::Site->new;
142            $site->create( name => $_ ) foreach ( qw/Pore Zagreb Sisak/ );
143  }  }
144    
145  1;  1;

Legend:
Removed from v.12  
changed lines
  Added in v.41

  ViewVC Help
Powered by ViewVC 1.1.26