Commit 6c90d4668589396367ae93920b790e09e347ce0b
1 parent
dd3276aa
leafletjs
Showing
7 changed files
with
106 additions
and
3 deletions
.gitignore
0 → 100644
configuration.xml
1 | <configuration> | 1 | <configuration> |
2 | 2 | ||
3 | <deep_datalet_configuration> | 3 | <deep_datalet_configuration> |
4 | - <components_repository_url_reference>http://192.168.164.128/DatalEts-Ecosystem-Provider/COMPONENTS/datalets/</components_repository_url_reference> | 4 | + <components_repository_url_reference>http://172.16.15.77/DEEalerProvider/COMPONENTS/datalets/</components_repository_url_reference> |
5 | </deep_datalet_configuration> | 5 | </deep_datalet_configuration> |
6 | 6 | ||
7 | <deep_controllets_configuration> | 7 | <deep_controllets_configuration> |
8 | - <components_repository_url_reference>http://192.168.164.128/DatalEts-Ecosystem-Provider/COMPONENTS/controllets/</components_repository_url_reference> | 8 | + <components_repository_url_reference>http://172.16.15.77/DEEalerProvider/COMPONENTS/controllets/</components_repository_url_reference> |
9 | </deep_controllets_configuration> | 9 | </deep_controllets_configuration> |
10 | 10 | ||
11 | </configuration> | 11 | </configuration> |
export/.htaccess
0 → 100644
export/deepexport.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +require '../Slim/Slim.php'; | ||
4 | + | ||
5 | +/** | ||
6 | +* Class DeepExport | ||
7 | +*/ | ||
8 | +class DeepExport | ||
9 | +{ | ||
10 | + private static $instance = null; | ||
11 | + private $app; | ||
12 | + | ||
13 | + public static function getInstance() | ||
14 | + { | ||
15 | + if(self::$instance == null) | ||
16 | + { | ||
17 | + $c = __CLASS__; | ||
18 | + self::$instance = new $c; | ||
19 | + } | ||
20 | + | ||
21 | + return self::$instance; | ||
22 | + } | ||
23 | + | ||
24 | + private function __construct() | ||
25 | + { | ||
26 | + \Slim\Slim::registerAutoloader(); | ||
27 | + $this->app = new \Slim\Slim(); | ||
28 | + | ||
29 | + $this->app->post('/export-datalet-as-img', function(){ | ||
30 | + if(!empty($this->app->request()->params('svg_data'))) { | ||
31 | + try { | ||
32 | + $svg = $this->app->request()->params('svg_data'); | ||
33 | + | ||
34 | + $chart = new Imagick(); | ||
35 | + $chart->setFormat('SVG'); | ||
36 | + $chart->readImageBlob($svg); | ||
37 | + $chart->setFormat("png24"); | ||
38 | + | ||
39 | + $logo = new Imagick(); | ||
40 | + $logo->readImage("pbrtpa.bmp"); | ||
41 | + | ||
42 | + $image = new Imagick(); | ||
43 | + $image->setFormat("png24"); | ||
44 | + $image->newImage($chart->getImageWidth() > $logo->getImageHeight() ? $chart->getImageWidth() : $logo->getImageWidth(), | ||
45 | + $chart->getImageHeight()+$logo->getImageHeight(), | ||
46 | + "white"); | ||
47 | + | ||
48 | + $image->compositeImage($chart, Imagick::COMPOSITE_COPY, 0, 0); | ||
49 | + $image->compositeImage($logo, Imagick::COMPOSITE_COPY, 20, $chart->getImageHeight()); | ||
50 | + | ||
51 | + echo $image; | ||
52 | + }catch (Exception $e){} | ||
53 | + } | ||
54 | + }); | ||
55 | + } | ||
56 | + | ||
57 | + public function run(){ | ||
58 | + //run the Slim app | ||
59 | + $this->app->run(); | ||
60 | + } | ||
61 | +} | ||
0 | \ No newline at end of file | 62 | \ No newline at end of file |
export/index.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +/* | ||
4 | +@license | ||
5 | + The MIT License (MIT) | ||
6 | + | ||
7 | + Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy | ||
8 | + | ||
9 | + Permission is hereby granted, free of charge, to any person obtaining a copy | ||
10 | + of this software and associated documentation files (the "Software"), to deal | ||
11 | + in the Software without restriction, including without limitation the rights | ||
12 | + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
13 | + copies of the Software, and to permit persons to whom the Software is | ||
14 | + furnished to do so, subject to the following conditions: | ||
15 | + | ||
16 | + The above copyright notice and this permission notice shall be included in | ||
17 | + all copies or substantial portions of the Software. | ||
18 | + | ||
19 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
20 | + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
21 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
22 | + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
23 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
24 | + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
25 | + THE SOFTWARE. | ||
26 | +*/ | ||
27 | + | ||
28 | +/** | ||
29 | + * Developed by : | ||
30 | + * ROUTE-TO-PA Project - grant No 645860. - www.routetopa.eu | ||
31 | + | ||
32 | + */ | ||
33 | + | ||
34 | +require 'deepexport.php'; | ||
35 | +DeepExport::getInstance()->run(); | ||
0 | \ No newline at end of file | 36 | \ No newline at end of file |
export/pbrtpa.bmp
0 → 100644
No preview for this file type
index.php
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | @license | 4 | @license |
5 | The MIT License (MIT) | 5 | The MIT License (MIT) |
6 | 6 | ||
7 | - Copyright (c) 2015 Dipartimento di Informatica - Università di Salerno - Italy | 7 | + Copyright (c) 2015 Dipartimento di Informatica - Universit� di Salerno - Italy |
8 | 8 | ||
9 | Permission is hereby granted, free of charge, to any person obtaining a copy | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | of this software and associated documentation files (the "Software"), to deal | 10 | of this software and associated documentation files (the "Software"), to deal |