forked from camptocamp/demo_geomapfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONST_CHANGELOG.txt
864 lines (645 loc) · 29.9 KB
/
CONST_CHANGELOG.txt
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
This file includes migration steps for each release of c2cgeoportal.
Version 2.1.2
=============
1. Rename the following file:
git mv deploy/hooks/post-{create,restore}
2. Add in the project vars file:
deploy:
code_source: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal
code_destination: /var/www/c2cgeoportal_mapfish/private/c2cgeoportal
with the right deploy path.
Version 2.1.0
=============
If you upgrade from the version 1.6.x be careful to apply the steps for the version 2.0 first.
In recent versions of GeoMapFish, `CGXP` has been replaced by `ngeo` to propose
a more modern interface to the end user. It is still possible to keep using
`CGXP` though.
If you want to keep the `CGXP` interface please read the following
documentation and then move directly to step 4:
https://camptocamp.github.io/c2cgeoportal/2.1/integrator/legacy_cgxp.html
After you upgrade the application you can use the following scripts to help you on upgrade
your data from CGXP to ngeo:
* `.build/venv/bin/themev1tov2` to migrate the themes
* `.build/venv/bin/l10nv1tov2` to migrate the localisation files (language strings)
Use the `--help` argument for more information.
You should also add a Layer group named 'background' with the background layers.
1. Get the new files for ngeo integration:
cp CONST_create_template/demo/templates/desktop.html demo/templates/
cp CONST_create_template/demo/static-ngeo/less/desktop.less demo/static-ngeo/less
cp CONST_create_template/demo/static-ngeo/js/desktop.js demo/static-ngeo/js
cp -r CONST_create_template/demo/static-ngeo/components demo/static-ngeo/
2. Remove the cgxp interfaces:
git rm demo/templates/index.html
git rm demo/templates/viewer.js
git rm demo/templates/edit.html
git rm demo/templates/edit.js
git rm demo/templates/routing.html
git rm demo/templates/routing.js
3. In the `demo/__init__.py` do the following replacement:
- add_interface(config)
- add_interface(config, "edit")
- add_interface(config, "routing")
+ add_interface(config, "desktop", INTERFACE_TYPE_NGEO)
4. Remove the no longer used files:
git rm CONST_versions.txt
git rm .jshintrc
5. Get the new and heavily modified files for ngeo integration:
chmod +x CONST_create_template/deploy/hooks/*
cp CONST_create_template/apache/wsgi.conf.mako apache/
cp CONST_create_template/deploy/hooks/* deploy/hooks/
6. The less build is simplified (be careful if you customized the style):
git rm demo/static-ngeo/less/mobile-build.less
cp CONST_create_template/demo/static-ngeo/less/mobile.less demo/static-ngeo/less
7. The checkers will be refactored, you should do at least the following
changes in your `vars_demo.yaml` (be careful if you use legacy components):
checker:
- fulltextsearch: text to search
- print_spec:
- layout: "1 A4 portrait"
- outputFormat: "pdf"
- attributes:
- title: ""
- comments: ""
- datasource: []
- map:
- projection: "EPSG:21781"
- dpi: 254
- rotation: 0
- center: [600000, 200000]
- scale: 100000
- longitudeFirst: true
- layers: []
- legend: {}
+ defaults:
+ routes_disable: []
+ fulltextsearch: text to search
+ print_spec:
+ layout: "1 A4 portrait"
+ outputFormat: "pdf"
+ attributes:
+ title: ""
+ comments: ""
+ datasource: []
+ map:
+ projection: "EPSG:21781"
+ dpi: 254
+ rotation: 0
+ center: [600000, 200000]
+ scale: 100000
+ longitudeFirst: true
+ layers: []
+ legend: {}
+ all:
+ routes_disable: []
check_collector:
+ disabled: []
hosts: []
...
update_paths:
...
- - checker
+ - checker.defaults
+ - checker.all
+ - check_collector.disabled
- check_collector.hosts
8. In your vars_demo.yaml file remove the host entry.
9. In your demo.mk add the following lines:
+ VISIBLE_WEB_HOST ?= example.com
+
+ # Deploy branch
+ DEPLOY_BRANCH_DIR ?= /var/www/vhosts/$(APACHE_VHOST)/private/deploybranch
+ GIT_REMOTE_URL ?= [email protected]:camptocamp/demo.git
+ DEPLOY_BRANCH_BASE_URL ?= $(VISIBLE_PROTOCOL)://$(VISIBLE_HOST)
+ DEPLOY_BRANCH_MAKEFILE ?= demo.mk
Where 'example.com' is the hostname use in the browser to open the application
10. In your vars_demo.yaml file rename `mobile_default_theme` to `default_theme`.
11. In your demo/__init__.py do the following change:
-from c2cgeoportal import locale_negotiator, add_interface, INTERFACE_TYPE_NGEO
+from c2cgeoportal.pyramid_ import locale_negotiator, add_interface, INTERFACE_TYPE_NGEO
12. The TileCloud chain config file format change a little bit, the main change to do is:
-layer_default:
- ...
+defaults:
+ layer: &layer
+ ...
and for all `layers:`
layers:
name:
+ <<: *layer
...
And if the dimensions are a number like 2016 they should be quoted => '2016'.
example: https://github.com/camptocamp/demo_geomapfish/commit/158c53b5f16c230744f0b101bb3b42a88a0bf969
13. To pre upgrade the database, run:
make -f <user>.mk .build/venv/bin/alembic alembic.ini production.ini .build/config.yaml
.build/venv/bin/alembic --config alembic.ini upgrade 7d271f4527cd
.build/venv/bin/treeitem_uniquename
If you are using Windows, then please replace `bin` with `scripts` in the paths
14. In the database we have added some restrictions, have a look here for more information:
https://github.com/camptocamp/c2cgeoportal/issues/2568
Version 2.0.0
=============
This changelog considers that you do not currently use an ngeo interface and you
replace your sencha touch interface by an ngeo interface.
If you want to keep the `Print version 2.x`, please read the following
documentation:
https://camptocamp.github.io/c2cgeoportal/2.1/integrator/legacy_print.html
You must also not remove the `print/print-servlet.war` (at step 2) and not
add it in the `.gitignore` (at step 3).
1. Get the new and heavily modified files for ngeo integration:
at that point, the following folder should exist: CONST_create_template
cp CONST_create_template/lingua-client.cfg .
cp CONST_create_template/lingua-server.cfg .
cp CONST_create_template/apache/wsgi.conf.mako apache/
cp -r CONST_create_template/demo/static-ngeo demo/
cp CONST_create_template/demo/templates/mobile.html demo/templates/
2. Remove the no longer used files:
git rm lingua.cfg
git rm -r demo/static/mobile/
git rm jsbuild/mobile.cfg
git rm print/print-servlet.war
3. Add in the `.gitignore` file:
+ /node_modules/
+ /print/print-servlet.war
+ /.tx/config
+ /.tx/ngeo.gmf-*
+ /demo/static-ngeo/build/
+ /demo/static-ngeo/fonts/gmf-icons.*
+ /demo/static-ngeo/fonts/fontawesome-webfont.*
+ /demo/version.py
+ /mapserver/replace_db.sh
+ /testDB/11-schemas.sql
+ /testDB/12-alembic.sql
+ /testDB/13-alembic-static.sql
* /testDB/Dockerfile
+ /.whiskey/action_hooks/pre-build
4. In the `vars_demo.yaml` file:
* Remove the `vars.checker.lang_files` parameter to use the default value
that checks the ngeo language files.
5. In the `demo/__init__.py` file:
* If your project's main function includes `config.include("pyramid_closure")`,
remove it, as c2cgeoportal now takes care of including `pyramid_closure`.
* Use the ngeo interface for the mobile by doing this changes:
- from c2cgeoportal import locale_negotiator, add_interface, \
- INTERFACE_TYPE_SENCHA_TOUCH, INTERFACE_TYPE_NGEO
+ from c2cgeoportal import locale_negotiator, add_interface, INTERFACE_TYPE_NGEO
...
- add_interface(config, "mobile", INTERFACE_TYPE_SENCHA_TOUCH)
+ add_interface(config, "mobile", INTERFACE_TYPE_NGEO)
6. If you have set the `cache_control` in your `vars_demo.yaml` file,
rename 'cache_control' to 'headers' and 'max_age' to
'cache_control_max_age':
- cache_control:
- "<service_name>":
- "max_age": <max_age>
+ headers:
+ "<service_name>":
+ "cache_control_max_age": <max_age>
7. On the `demo/models.py` remove the following lines:
- LayerInternalWMS.__acl__ = [DENY_ALL]
- LayerExternalWMS.__acl__ = [DENY_ALL]
- LayerWMTS.__acl__ = [DENY_ALL]
- WMTSDimension.__acl__ = [DENY_ALL]
8. It is not allowed anymore to have layers directly in a theme.
Version 1.6.8
=============
1. In the file `print/WEB-INF/classes/logback.xml.mako` do the following replacement:
- <file>build/logs/logFile.log</file>
+ <file>logs/${instanceid}.log</file>
- <fileNamePattern>build/logs/logFile.%d{yyyy-MM-dd}.log</fileNamePattern>
+ <fileNamePattern>logs/${instanceid}.%d{yyyy-MM-dd}.log</fileNamePattern>
2. In the `deploy/hooks/pre-restore-database.mako` file add:
cd "${directory}"
before
.build/venv/bin/alembic -c alembic_static.ini upgrade head
Version 1.6.7
=============
1. To be able to update the static schema on deploy, we must have the latest
Alembic upgrade script and for that the new `restore_order` parameter must be
added to the `main` block in the `deploy/deploy.cfg.mako` file:
[main]
+# to update the static schema, we need to deploy the code first
+restore_order = code,database,files
2. Add the following lines in your `jsbuild/app.cfg.mako` file to get the french and german
translation for some of the print panel strings:
[lang-fr.js]
...
include =
...
+ locale/SimplePrint-fr.js
[lang-de.js]
...
include =
...
+ locale/SimplePrint-de.js
3. Update the `configureHttpRequests` of the print v3 template to:
- !configureHttpRequests &configureHttpRequests
httpProcessors:
- !mapUri
matchers:
- !dnsMatch
host: ${host}
mapping:
(https?)://${host}/(.*): "http://127.0.0.1/$2"
- !forwardHeaders
matchers:
- !localMatch {}
headers:
- Cookie
- Host
- !forwardHeaders
headers:
- Referer
- !restrictUris
matchers:
- !localMatch
pathRegex: "/${instanceid}/wsgi/mapserv_proxy"
- !localMatch
pathRegex: "/${instanceid}/tiles/.*"
- !localMatch
reject: true
- !ipMatch
ip: 10.0.0.0
mask: 255.0.0.0
reject: true
- !ipMatch
ip: 172.16.0.0
mask: 255.240.0.0
reject: true
- !ipMatch
ip: 192.168.0.0
mask: 255.255.0.0
reject: true
- !acceptAll {}
Version 1.6.6
=============
1. Now the files `apache/mapcache.xml` and `apache/tiles.conf` are generated automatically,
then you can remove your custom build rules.
If you do not use tilecloud-chain and you do not have a `tilegeneration/config.yaml` configuration
file, you must disable it by setting the following parameter in your Makefile:
`TILECLOUD_CHAIN ?= FALSE`
Version 1.6.5
=============
1. In the PDF report config the show_map attribute will be removed and a map is added in the config hierarchy.
See the doc to update your config: https://camptocamp.github.io/c2cgeoportal/1.6/integrator/pdfreport.html
2. If you use ngeo in your project edit `build.json`, located at the root of the project, and change the
`templatecache.js` line:
- ".build/templatecache.js"
+ "demo/static/build/templatecache.js"
3. If you use ngeo you need to update your project to Angular 1.4.x (1.4.7 is the latest version). For this
you need to change two files: `build.json` and `package.json`.
Changes to `build.json`:
- ".build/externs/angular-1.3.js",
- ".build/externs/angular-1.3-q.js",
- ".build/externs/angular-1.3-http-promise.js",
+ ".build/externs/angular-1.4.js",
+ ".build/externs/angular-1.4-q_templated.js",
+ ".build/externs/angular-1.4-http-promise_templated.js",
Changes to `package.json`:
- "angular": "1.3.4",
+ "angular": "1.4.7",
Version 1.6.3
=============
1. To use the MapFish print v3 protocol from the CGXP client add the following config
lines in the `cgxp_print` plugin in the `demo/templates/viewer.js` file:
+ version: 3
2. To still use Mapfish Print v2 you should:
* In the `vars_demo.yaml` file, add the following variable
print_url: http://localhost:8080/print-{instanceid}/pdf/
* Add also in the `check_collector` variable the following variable:
check_collector:
+ disabled: [checker_print3capabilities, checker_pdf3]
* Add the following line in your demo.mk file:
PRINT_VERSION = 2
* Be sure that you moved your file `print/templates/print.mako.in`
to `print/config.yaml.mako` and did the required changes.
3. In all `mapserver/*.map` or `mapserver/*.map.mako` files, convert all SRS
codes in METADATA sections to uppercase.
Lowercase SRS codes may cause incompatibility problems with some client
tools including CGXP WMSBrowser plugin.
Exemple:
METADATA
...
"wms_srs" "epsg:21781 epsg:3857"
...
END
should be converted to:
METADATA
...
"wms_srs" "EPSG:21781 EPSG:3857"
...
END
Note that “epsg” has to be in lowercase when used in the PROJ4 ‘init’ directive.
PROJECTION
"init=epsg:21781"
END
4. In all `mapserver/*.map` or `mapserver/*.map.mako` files, adding an EXTENT to all
LAYER definitions will be a great performance improvement, see:
https://camptocamp.github.io/c2cgeoportal/1.6/administrator/mapfile.html#performance-improvement
5. In `vars_demo.yaml` file add `admin_interface` key in `update_paths`:
update_paths:
- authtkt
- checker
- check_collector.hosts
+ - admin_interface
6. In the `demo/templates/index.html`, `demo/templates/edit.html`
and `demo/templates/routing.html` do the following changes to use IE11 when available :
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9; IE=EmulateIE10">
+ <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9; IE=EmulateIE11">
7. Remove the `lang_files` from the `vars/checker` in the file `vars_demo.yaml`.
8. If in your `vars_demo.yaml` file you have the following `available_functionalities` they can be removed
because they are the default settings:
# The list of functionalities that can be configured
# through the admin interface.
available_functionalities:
- default_basemap
- print_template
- mapserver_substitution
9. In the Mapfish print v3 configuration do the following change ([htps] => https?):
- !configureHttpRequests
httpProcessors:
- !mapUri
mapping:
- ([htps])://${host}/(.*): "$1://127.0.0.1/$2"
+ (https?)://${host}/(.*): "$1://127.0.0.1/$2"
10. In the Mapfish print v3 configuration do the following change:
- !configureHttpRequests
httpProcessors:
...
- !forwardHeaders
headers:
- Cookie
- Host
- - Referrer
+ - Referer
11. In the `apache/application.wsgi.mako` add the following lines:
import site
+import sys
+import re
site.addsitedir("${python_path}")
+# Remove site packages
+regex = re.compile("^/usr/lib/python.\../dist-packages$")
+sys.path = [p for p in sys.path if regex.match(p) is None]
+
from pyramid.paster import get_app, setup_logging
configfile = "${directory}/${'development' if development == 'TRUE' else 'production'}.ini"
12. On deploy `post-restore-database.mako` must be renamed to `pre-restore-database.mako` and deeply modified.
If you did not modify it you can just copy the new version with the following:
mv deploy/hooks/post-restore-database.mako deploy/hooks/pre-restore-database.mako
cp /tmp/demo_geomapfish/deploy/hooks/pre-restore-database.mako deploy/hooks
chmod +x deploy/hooks/pre-restore-database.mako
and the `.gitignore` file should also be adapted:
- /deploy/hooks/post-restore-database
+ /deploy/hooks/pre-restore-database
11. In the PDF report config the show_map attribute will be removed and a map is added in the config hierarchy.
See the doc to update your config: https://camptocamp.github.io/c2cgeoportal/1.6/integrator/pdfreport.html
Version 1.6.2
=============
1. In the `demo/models.py` add the following lines:
from pyramid.security import DENY_ALL
LayerInternalWMS.__acl__ = [DENY_ALL]
LayerExternalWMS.__acl__ = [DENY_ALL]
LayerWMTS.__acl__ = [DENY_ALL]
WMTSDimension.__acl__ = [DENY_ALL]
2. If you still use version 2 of the print the `.war` file should be updated to the latest version.
cd print
wget http://pypi.camptocamp.net/print-servlet-2.1-SNAPSHOT-IMG-MAGICK-daeea96d2d3b33d6ccf02fe62d81b9c7aa2574a2.war
mv print-servlet-2.1-SNAPSHOT-IMG-MAGICK-daeea96d2d3b33d6ccf02fe62d81b9c7aa2574a2.war print-servlet-2.1-SNAPSHOT-IMG-MAGICK.war
touch print-servlet-2.1-SNAPSHOT-IMG-MAGICK.war
3. In the `demo/__init__.py` file remove all the `config.add_settings({ ... })`, they should be in the `vars_*.yaml` files.
In the `vars_*.yaml` file, the `closure_library_path` configuration variable and the entry in the `interpreted`
section can be removed:
closure_library_path: 'process.stdout.write(require("openlayers/node_modules/closure-util").getLibraryPath())'
node:
vars:
- closure_library_path
cmd: ["node", "-e"]
It is now directly defined in the CONST_vars.yaml file.
Version 1.6
===========
1. Warning about .in and .mako files
In c2cgeoportal 1.6, the .in are globally replaced by .mako
.in STILL WORK!
You can keep the .in, the system is backward compatible,
or you can choose to replace your .in by .mako, to stick to c2cgeoportal
evolution.
.mako offer more flexibility, so it is advised to replace the .in
by .mako
Please note the following syntax changes:
- a variable named ${vars:<varname>} in a .in will be written ${<varname>} in
a .mako.
- ${buildout:directory} must be replaced by ${directory}.
Also, in all the CHANGELOG points specifying both .in/.mako files, it means
you need to modify the file you have (either the .in or the .mako), you MUST
NOT have both files.
2. Follow the instructions explained in this documentation chapter:
https://camptocamp.github.io/c2cgeoportal/1.6/integrator/upgrade_application.html#easy-upgrading-an-application-from-1-5-to-1-6
3. Get the new and heavily modified files:
at that point, the following folder should exist: /tmp/demo_geomapfish/
cp /tmp/demo_geomapfish/.gitignore .
cp /tmp/demo_geomapfish/.jshintrc .
cp /tmp/demo_geomapfish/.travis.yml .
cp /tmp/demo_geomapfish/travis.mk .
cp /tmp/demo_geomapfish/demo.mk .
cp /tmp/demo_geomapfish/README.rst .
cp /tmp/demo_geomapfish/alembic.ini.mako .
cp /tmp/demo_geomapfish/alembic_static.ini.mako .
cp /tmp/demo_geomapfish/build.json .
cp /tmp/demo_geomapfish/development.ini.mako .
cp /tmp/demo_geomapfish/lingua.cfg .
cp /tmp/demo_geomapfish/package.json .
cp /tmp/demo_geomapfish/production.ini.mako .
cp /tmp/demo_geomapfish/vars_demo.yaml .
cp /tmp/demo_geomapfish/deploy/hooks/post-restore-code deploy/hooks
cp /tmp/demo_geomapfish/apache/application.wsgi.mako apache/
chmod +x deploy/hooks/post-restore-code
4. Starting from version 1.6 we use a new build system based on Make that will change
many of your habits, information are given at:
https://camptocamp.github.io/c2cgeoportal/1.6/integrator/make.html
Main things to do:
- Move your old `config.yaml` and your `[vars]` section of the old
`buildout.cfg` file to the new `vars_demo.yaml` file in the `vars:` parameter.
- Move your special task from your old `buildout.cfg` file to your new
`demo.mk` file
- The `README.rst`, `.gitignore` files will be overwritten.
Please make sure to back your changes up before proceeding.
- The `development.ini.in`, `production.ini.in` files will be replaced by
the `development.ini.mako`, `production.ini.mako` files. If you lost
something it should probably be moved in the `vars_demo.yaml` file.
- The `print/template/print.mako.in` file should be moved to
`print/config.yaml.mako`. The paths provided in `print/config.yaml.mako`
must be adapted accordingly. For instance:
`<%include file="/A4_portrait.mako" />` should be changed to
`<%include file="templates/A4_portrait.mako" />`.
- The build environments (`<user>.mk` files) must be recreated.
For multi project mode have a look at the documentation:
https://camptocamp.github.io/c2cgeoportal/1.6/integrator/create_application.html
5. In the `setup.cfg` file you should remove all the `[compile_catalog]`,
`[extract_messages]`, `[init_catalog]`, `[update_catalog]` sections.
6. In the `setup.py` file you should remove the `message_extractors`
argument.
7. In the demo/__init__.py file do the following changes:
-from c2cgeoportal import locale_negotiator
+from c2cgeoportal import locale_negotiator, add_interface, INTERFACE_TYPE_SENCHA_TOUCH
Replace all the mobile view configuration (all the `config.add_route ...`,
`config.add_view ...` under the line "# mobile views and routes") by the
following lines:
+ add_interface(config)
+ add_interface(config, 'edit')
+ add_interface(config, 'routing')
+ add_interface(config, 'mobile', INTERFACE_TYPE_SENCHA_TOUCH)
Remove the activation of the static view (now done directly in c2cgeoportal):
- # add the main static view
- config.add_static_view(
- name='proj',
- path='demo:static',
- cachebust=True,
- )
Remove the activation of the admin interface (now done directly in c2cgeoportal):
- if asbool(config.get_settings().get('enable_admin_interface')):
- config.formalchemy_admin(
- 'admin', package='demo',
- view='fa.jquery.pyramid.ModelView', factory=FAModels
- )
Remove the activation of the checkers (now done directly in c2cgeoportal):
- config.add_route('checker_all', '/checker_all')
8. In the `demo/templates/*.html` files you should do the following
changes:
- jsbuild_cfg = request.registry.settings.get('jsbuild_cfg')
- jsbuild_root_dir = request.registry.settings.get('jsbuild_root_dir')
+ jsbuild_settings = request.registry.settings.get('jsbuild', {})
+ jsbuild_cfg = jsbuild_settings.get('config')
+ jsbuild_root_dir = jsbuild_settings.get('root_dir')
Remove the no more needed `_query=url_params` argument of the
`static_url` calls.
9. In the `demo/templates/*.js` files do the following changes:
- <% json_extent = user.role.json_extent if user else None %>
- % if json_extent:
- var INITIAL_EXTENT = ${json_extent};
+ <% bounds = user.role.bounds if user else None %>
+ % if bounds:
+ var INITIAL_EXTENT = ${dumps(bounds)};
replace `url_role_params` by `version_role_params` in all the file.
in the WMTS_OPTIONS add the following lines:
+ getURL: function() {
+ var url = OpenLayers.Layer.WMTS.prototype.getURL.apply(this, arguments);
+ return url + "?${'&'.join(["%s=%s" % p for p in version_params.items()]) | n}";
+ },
10. In the `demo/templates/*.js`, `demo/templates/api/*.js`,
`demo/static/mobile/config.js`, `demo/static/mobile/index.html`
files add ` | n` after all the `static_url` and `route_url` call, like:
- "${request.static_url('...')}"
+ "${request.static_url('...') | n}"
11. In the `demo/templates/edit.js` file
add the following attribute to the `cgxp_editing` plugin:
+ metadataParams: ${dumps(version_role_params) | n}
12. In the mapfile add the following lines to all restricted layers:
VALIDATION
${mapserver_layer_validation}
END
13. Remove the deprecated versioning table:
sudo -u postgres psql -c "DROP TABLE version_demo" <database>
14. For non Apt/Dpkg based OS, disable the package checking:
In the ``buildout.cfg`` section ``[buildout]`` add:
parts -=
test-packages
test-packages-mobile
test-packages-tilecloud-chain
15. In the `demo/static/mobile/config.js` add the following line at the top of the file:
+OpenLayers.ImgPath = "${request.static_url('demo:static/lib/cgxp/core/src/theme/img/ol/') | n}";
16. Move the `jsbuild/app.cfg` file to `jsbuild/app.cfg.mako`.
Add the following lines in the start of the file:
<%
root = [
"demo/static/lib/cgxp/core/src/script",
"demo/static/lib/cgxp/ext",
"demo/static/lib/cgxp/geoext/lib",
"demo/static/lib/cgxp/openlayers/lib",
"demo/static/lib/cgxp/openlayers.addins/GoogleEarthView/lib",
"demo/static/lib/cgxp/openlayers.addins/Spherical/lib",
"demo/static/lib/cgxp/openlayers.addins/URLCompressed/lib",
"demo/static/lib/cgxp/openlayers.addins/DynamicMeasure/lib",
"demo/static/lib/cgxp/openlayers.addins/AddViaPoint/lib",
"demo/static/lib/cgxp/openlayers.addins/AutoProjection/lib",
"demo/static/lib/cgxp/gxp/src/script",
"demo/static/lib/cgxp/proj4js",
"demo/static/lib/cgxp/geoext.ux/ux/Measure/lib",
"demo/static/lib/cgxp/geoext.ux/ux/SimplePrint/lib",
"demo/static/lib/cgxp/geoext.ux/ux/FeatureEditing/lib",
"demo/static/lib/cgxp/geoext.ux/ux/FeatureSelectionModel/lib",
"demo/static/lib/cgxp/geoext.ux/ux/WMSBrowser/lib",
"demo/static/lib/cgxp/geoext.ux/ux/StreetViewPanel",
"demo/static/lib/cgxp/sandbox",
"demo/static/lib/cgxp/styler/lib",
"demo/static/lib/cgxp/ext.ux/TwinTriggerComboBox",
"demo/static/lib/cgxp/ext.ux/GroupComboBox",
"demo/static/lib/cgxp/ext.ux/ColorPicker",
"demo/static/lib/cgxp/ext.ux/base64",
"demo/static/lib/cgxp/ext.overrides",
"demo/static/lib/cgxp/dygraphs",
"demo/static/js",
]
%>
Replace all the root sections (for all built files) by:
root =
${"\n ".join(root)}
17. Remove your Apache configuration file, probably in
`/var/www/vhost/demo_geomapfish/conf`. Now it will be automatically created.
To define a customized path, set the variables APACHE_VHOST and/or
APACHE_CONF_DIR in your `<user>.mk` file.
18. Notes on database changes:
* In prevision of GeoMapFish 2.0 some tables were added and some fields updated.
* Table ``user`` has been moved to schema ``main_static`` in order to store all
data modified by the web application in the same schema.
As a result the passwords no longer need to be synchronised among the various instances
of the application and the password replication tool has been removed.
19. Add at the end of the `deploy/hooks/post-restore-database.mako` or
`deploy/hooks/post-restore-database.in` file the following line:
+ .build/venv/bin/alembic -c alembic_static.ini upgrade head
20. In your `apache/wsgi.conf.mako` or `apache/wsgi.conf.in` file replace all the
`apache-entry-point` by `apache_entry_point`
21. In your `apache/frontend.conf.mako` or `apache/frontend.conf.in` file in the
`<LocationMatch /${instanceid}/wsgi/>` section,
add the following mimetypes to the existing list:
... application/vnd.ogc.wms_xml application/vnd.ogc.gml application/vnd.ogc.se_xml
and in the `<LocationMatch /${instanceid}/tiles/>` section,
add the following lines:
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/xml
Header add Access-Control-Allow-Headers "X-Requested-With, Content-Type"
22. In the `demo/subscribers.py`, `demo/models.py`, `demo/forms.py` files do the following changes:
-... = TranslationStringFactory('demo')
+... = TranslationStringFactory("demo-server")
23. In the `demo/subscribers.py` file do the following change:
- return localizer.translate(tsf2(localizer.translate(tsf1(string))))
+ result = localizer.translate(tsf1(string))
+ return localizer.translate(tsf2(string)) if result == string else result
24. Add the `print_spec` in the `checker` config `vars_demo.yaml` file:
checker:
...
print_spec:
layout: "A4 portrait"
outputFormat: "pdf"
attributes:
title: ""
comments: ""
datasource: []
map:
projection: "EPSG:21781"
dpi: 254
rotation: 0
center: [600000, 200000]
scale: 100000
longitudeFirst: true
layers: []
legend: {}
25. Remove the deprecated files:
git rm -r demo/CONST_migration
git rm -r demo/static/build
git rm config.yaml.in
git rm bootstrap.py
git rm -r *buildout*
git rm development.ini.in production.ini.in
git rm versions.cfg
26. In your `apache/wsgi.conf.in` or `apache/wsgi.conf.mako` file, do the
following change:
- WSGIScriptAlias /${vars:instanceid}/wsgi ${buildout:directory/buildout/parts/modwsgi/wsgi}
+ WSGIScriptAlias /${instanceid}/wsgi ${directory}/apache/application.wsgi