/[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 4 by dpavlin, Thu Nov 29 11:20:24 2007 UTC revision 46 by dpavlin, Sun Apr 6 15:36:03 2008 UTC
# Line 4  use strict; Line 4  use strict;
4  package Arh::Bootstrap;  package Arh::Bootstrap;
5  use base qw(Jifty::Bootstrap);  use base qw(Jifty::Bootstrap);
6    
7    use Data::Dump qw/dump/;
8    use utf8;
9    
10  =head1 Bootstrap application data  =head1 Bootstrap application data
11    
12  Create initial data  Create initial data
# Line 11  Create initial data Line 14  Create initial data
14  =cut  =cut
15    
16  sub run {  sub run {
17            #warn "## run",dump(@_);
18      my $self = shift;      my $self = shift;
19    
20          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );          my $system_user = Arh::CurrentUser->superuser( _bootstrap => 1 );
21    
22    
23            my $u = Arh::Model::User->new(current_user => $system_user);
24    
25            $u->create(
26                    name => 'Admin',
27                    lastname => 'User',
28                    email => 'admin@example.com',
29                    email_confirmed => 1,
30                    password => 'password',
31                    administrator => 1,
32                    organization => 'Site administrator',
33                    editing => 1,
34            );
35    
36            $u->create(
37                    name => 'Anonymous',
38                    lastname => 'User',
39                    email => 'anonymous@example.com',
40                    email_confirmed => 1,
41                    password => 'password',
42                    administrator => 0,
43                    organization => 'Part of anonymous user crowd',
44            );
45    
46          my $pt = Arh::Model::PictureType->new(current_user => $system_user);          my $pt = Arh::Model::PictureType->new(current_user => $system_user);
47                    
48          $pt->create( name => $_ ) foreach ( qw/          $pt->create( name => $_ ) foreach ( qw/
# Line 23  slika Line 51  slika
51  rekonstrukcija  rekonstrukcija
52  aksiometrija  aksiometrija
53  arhitektura  arhitektura
54  namje¹taj  namjeÅ¡taj
55  / );  / );
56    
57            my $chronology_8 = Arh::Model::Chronology->new(current_user => $system_user);
58            $chronology_8->create(
59                    name => '8. stoljeće',
60                    year_from => 701,
61                    year_to => 800,
62            );
63            my $chronology_end8 = Arh::Model::Chronology->new(current_user => $system_user);
64            $chronology_end8->create(
65                    name => 'kraj 8. stoljeća',
66                    year_from => 760,
67                    year_to => 800,
68                    part_of => $chronology_8,
69            );
70    
71    
72            my $material = Arh::Model::Material->new;
73            $material->create(
74                    name => 'tvrdi vapnenac',
75            );
76    
77            my $material2 = Arh::Model::Material->new;
78            $material2->create(
79                    name => 'nepoznato',
80            );
81    
82            my $location = Arh::Model::Location->new;
83            $location->create(
84                    name => 'Lapidarij u Balama',
85            );
86            $location->create(
87                    name => 'Katedralni kompleks',
88            );
89    
90    
91            my $place = Arh::Model::Place->new;
92            $place->create(
93                    name => 'mjesto iskapanja',
94            );
95    
96    
97            my $campaign = Arh::Model::Campaign->new(current_user => $system_user);
98            $campaign->create(
99                    place => $place,
100                    name => 'prvo iskapanje',
101                    date_from => '2007-11-28',
102                    date_to => '2008-03-15',
103            );
104    
105            my $cat = Arh::Model::Category->new;
106            $cat->create( name => $_ ) foreach ( qw/
107                    arhitektura
108                    skulptura
109                    slikarstvo
110                    liturgijske
111                    instalacije
112                    epigrafija
113                    metal
114            / );
115    
116            my $site = Arh::Model::Site->new;
117            $site->create( name => $_ ) foreach ( qw/
118                    PoreÄ
119            / );
120    
121            my $unit = Arh::Model::Unit->new(current_user => $system_user);
122            $unit->create(
123                    unit_id => '01/01',
124                    name => 'Eufrazijeva bazilika',
125                    subcategory => 'crkva',
126                    category => $cat,
127                    location => $location,
128                    site => $site,
129                    # gps
130                    placement => 'SjeveroistoÄno od antiÄkog foruma, uz sjeverne zidine grada',
131                    context => 'urbani',
132                    function => 'Katedrala',
133                    ownership => 'KatoliÄka crkva - poreÄko-pulska biskupija',
134                    dimensions => '20x35x15m',
135                    condition => 'Very good',
136                    toplogy => 'Trobrodna bazilika s apsidom i dvije apsidiole',
137                    # material
138                    technique => 'Opus incertum',
139                    description => "Trobrodna bazilika s istaknutom srednjom apsidom (izvana poligonalna iznutra polukružna)\ndvije boÄne apsidiole upisane u ravni zaÄeljni zid.",
140                    construction => "Stupovi s kapitelima i impostima;\ndrveno greÄ‘e, otvoreno kroviÅ¡te",
141                    decoration => "Podni mozaik, zidni mozaik, Å¡tuko",
142                    chronology => $chronology_end8,
143                    bibliography => 'M. Prelog; A.Terry, I. MatejÄić',
144                    copyright => 'I. MatejÄić',
145            );
146    
147            my $um = Arh::Model::UnitMaterial->new;
148            $um->create(
149                    unit => $unit,
150                    material => $material,
151            );
152            $um->create(
153                    unit => $unit,
154                    material => $material2,
155            );
156    
157    =for later
158            $unit->create(
159                    name => 'Staklo',
160                    inventory_nr => 'SMV - 42/60',
161                    campaign => $campaign,
162                    chronology => $chronology_8,
163                    location => $location,
164            );
165    
166            $um->create(
167                    unit => $unit,
168                    material => $material2,
169            );
170    
171    =cut
172    
173  }  }
174    
175  1;  1;

Legend:
Removed from v.4  
changed lines
  Added in v.46

  ViewVC Help
Powered by ViewVC 1.1.26