-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickstart-geo-2.0.roo
173 lines (141 loc) · 7.4 KB
/
quickstart-geo-2.0.roo
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
//Creating Petclinic project
project setup --topLevelPackage com.springsource.petclinic --projectName petclinic
// Persistence
jpa setup --provider HIBERNATE --database HYPERSONIC_PERSISTENT
// Enumerates
enum type --class ~.reference.PetType
enum constant --name Dog
enum constant --name Cat
enum constant --name Bird
enum type --class ~.reference.Specialty
enum constant --name Cardiology
enum constant --name Dentistry
enum constant --name Nutrition
// Creating entitys and fields
entity jpa --class ~.domain.Pet --sequenceName PET_SEQ
entity jpa --class ~.domain.Visit --sequenceName VISIT_SEQ
entity jpa --class ~.domain.AbstractPerson --abstract
entity jpa --class ~.domain.Vet --extends ~.domain.AbstractPerson
entity jpa --class ~.domain.Owner --extends ~.domain.AbstractPerson
field string --fieldName firstName --sizeMin 3 --sizeMax 30 --class ~.domain.AbstractPerson
field string --fieldName lastName --notNull --sizeMin 3 --sizeMax 30
field string --fieldName address --notNull --sizeMax 50 --sizeMin 1
field string --fieldName city --notNull --sizeMax 30
field string --fieldName telephone --notNull
field string --fieldName homePage --sizeMax 30
field string --fieldName email --sizeMax 30 --sizeMin 6
field date --fieldName birthDay --type java.util.Date --notNull
field string --fieldName description --sizeMax 255 --class ~.domain.Visit
field date --fieldName visitDate --type java.util.Date --notNull --past
field reference --fieldName pet --type ~.domain.Pet --notNull
field reference --fieldName vet --type ~.domain.Vet
field boolean --fieldName sendReminders --notNull --primitive --class ~.domain.Pet
field string --fieldName name --notNull --sizeMin 1
field number --fieldName weight --type java.lang.Float --notNull --min 0
field reference --fieldName owner --type ~.domain.Owner
field enum --fieldName type --type ~.reference.PetType --notNull
field date --fieldName employedSince --type java.util.Calendar --notNull --past --class ~.domain.Vet
field enum --fieldName specialty --type ~.reference.Specialty --notNull false
field set --class ~.domain.Owner --fieldName pets --type ~.domain.Pet --mappedBy owner --notNull false --cardinality ONE_TO_MANY
field set --class ~.domain.Vet --fieldName visits --type ~.domain.Visit --mappedBy vet --notNull false --cardinality ONE_TO_MANY
field reference --fieldName owner --type ~.domain.Owner --class ~.domain.Vet
field set --fieldName vets --type ~.domain.Vet --class ~.domain.Owner --cardinality ONE_TO_MANY --mappedBy owner
field set --fieldName visits --type ~.domain.Visit --class ~.domain.Pet --cardinality ONE_TO_MANY --mappedBy pet
// Adding finders
finder add --finderName findPetsByNameAndWeight --class ~.domain.Pet
finder add --finderName findPetsByOwner
finder add --finderName findPetsBySendRemindersAndWeightLessThan
finder add --finderName findPetsByTypeAndNameLike
finder add --finderName findVisitsByDescriptionAndVisitDate --class ~.domain.Visit
finder add --finderName findVisitsByVisitDateBetween
finder add --finderName findVisitsByDescriptionLike
// Adding web layers
web mvc setup
web mvc all --package ~.web
web mvc finder all
web mvc language --code de
web mvc language --code es
// Enable gvNIX JPA utilities
jpa gvnix setup
// Creates a Spring @Service class with methods for entity batch updates
jpa batch all
// Enable gvNIX Web MVC Batch utilities
web mvc batch setup
// Add support for JPA batch operations in all controllers
web mvc batch all
// Adding JQuery, Datatables and Bootstrap
web mvc jquery setup
web mvc datatables setup
web mvc jquery all
web mvc bootstrap setup
// Creating master patterns
web mvc datatables add --type ~.web.VetController --mode show
web mvc datatables add --type ~.web.PetController
web mvc datatables add --type ~.web.OwnerController
web mvc datatables add --type ~.web.VisitController --inline true --ajax true
/////// At this point, the application is complete, and you can run
// Pattern: master table Owner > detail table Pet
web mvc datatables detail add --type ~.web.OwnerController --property pets
// Pattern: master table Owner > detail table Vet
web mvc datatables detail add --type ~.web.OwnerController --property vets
// Pattern: master table Owner > detail table Pet > detail table Visit
web mvc datatables detail add --type ~.web.PetController --property visits
// Pattern: master table Owner > detail table Vet > detail table Visit
web mvc datatables detail add --type ~.web.VetController --property visits
// Setup menu
menu setup
// Adding Spring security
security setup
// Adding reports
web report setup
web report add --controller ~.web.OwnerController --reportName report_owners
// Adding Optimistic Concurrency Control
occ checksum set --entity ~.domain.Pet
// Adding Tests
test integration --entity ~.domain.Vet
test integration --entity ~.domain.Owner
test integration --entity ~.domain.Pet
test integration --entity ~.domain.Visit
selenium test --controller ~.web.OwnerController
selenium test --controller ~.web.PetController
selenium test --controller ~.web.VetController
selenium test --controller ~.web.VisitController
logging setup --level INFO
// Dynamic Configuration
configuration create --name local
configuration property add --name log4j.rootLogger
configuration property value --configuration local --property log4j.rootLogger --value ERROR
configuration list
configuration export
// Adding Web Services
remote service define ws --class ~.services.PetsServices --serviceName ws_get_all_pets
remote service operation --name ws_list_pets --service ~.services.PetsServices
// Modifying persistence to use POSTRGRES database with geo spatial support
jpa setup --provider HIBERNATE --database POSTGRES --userName gvnix --databaseName postgis_example --password gvnix --hostName localhost
// Adding spatial support to our project
jpa geo setup --provider HIBERNATE_SPATIAL
// Adding new geo fields to Owner entity
field geo --fieldName location --type POINT --class ~.domain.Owner
field geo --fieldName distance --type LINESTRING --class ~.domain.Owner
field geo --fieldName area --type POLYGON --class ~.domain.Owner
// Generating geo entity finders
finder geo all
// Modifying entity field to use Geo component
web mvc geo field --controller ~.web.OwnerController --field location
web mvc geo field --controller ~.web.OwnerController --field distance
web mvc geo field --controller ~.web.OwnerController --field area
// Creating different map views
web mvc geo controller --class ~.web.MapViewerController --preferredMapping mapview
web mvc geo controller --class ~.web.MapController --preferredMapping map
// Generating all entities geo web layer
web mvc geo entity all
// Adding base layers to our maps views
web mvc geo tilelayer --name satellit --url "http://maptile.maps.svc.ovi.com/maptiler/maptile/newest/satellite.day/{z}/{x}/{y}/256/png8"
web mvc geo wmslayer --name "geological map of valencia" --url "http://mapas.igme.es/gis/services/Cartografia_Geologica/IGME_GeologicoCValenciana_400/MapServer/WMSServer" --format "image/png" --transparent true --version "1.1.1" --crs EPSG4326 --layers "0,1,2,3"
// Adding tools to our maps views
web mvc geo tool measure --name measure
web mvc geo tool custom --name latlng --icon fa-location-arrow --activateFunction activateLatLngTool --deactivateFunction deactivateLatLngTool --iconLibrary fa
// Adding monitoring
monitoring setup
// Before run your application, you need to make this change:
// - To solve a problem with Tomcat7, go to http://tomcat.apache.org/maven-plugin-trunk/snapshot-test.html and follow the instructions.