Add plugin on Docker image

194 views
Skip to first unread message
Assigned to offth...@gmail.com by me

Jonathan Durand

unread,
Aug 17, 2020, 11:17:43 AM8/17/20
to mapstore-users
Hi,

I am a beginner on mapstore
I am using the Docker version of mapstore2-georchestra and I want to add a new "homemade" plugin to it.
Is it possible to do this (via the docker-compose file) ? Or do I have to create a new MapSotre project?

Thank you

Mauro Bartolomeoli

unread,
Aug 26, 2020, 3:08:01 AM8/26/20
to mapstor...@googlegroups.com
Good morning Jonathan,
there are two ways to add functionality to MapStore (or a MapStore project like the geOrchestra one you are using):
 - add it at build time, that requires you building a new project or extending the geOrchestra one in your case
 - build an extension that can be added at runtime

Extensions can be uploaded using the MapStore UI and saved on the server.
I suggest you to read the following documentation to understand if this is the way to go for you:

 - MapStore - GeoOrchestra configuration (in particular the last section on dynamic files storage): https://docs.georchestra.geo-solutions.it/en/latest/configuration/index.html (Long story short, if you configure your MapStore GeOrchestra to use a mounted folder for dynamic files, you can persist the extensions configuration outside of the docker container)
 - MapStore guide to extensions development: https://mapstore.readthedocs.io/en/latest/developer-guide/extensions/

Let me know if this is useful for your purpose.

Mauro


--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mapstore-users/0824d9f1-5f37-43c5-9009-39cbf45132e5n%40googlegroups.com.


--

Regards,

Mauro Bartolomeoli

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==

Dott. Mauro Bartolomeoli
@mauro_bart
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

mobile: +39 393 904 1756
phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.

This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.

Message has been deleted
Message has been deleted
Message has been deleted

Maxime Gourlay

unread,
Sep 28, 2020, 8:39:32 AM9/28/20
to mapstore-users
Hi, 

According to the document you shared, I actually tried to upload the "SampleExtension" on a mapstore2-georchestra project.
I create a zip file thanks to the documentation (translations folder, index.json and renamned the SampleExtension.js builded, in index.js).

Everything seem to work perfectly but, the extansion doesn't appear unfortunately. Is there other things to do ? It seems that the extansion isn't loaded, no error message, etc. (npm run run-extension works fine and display the extansion).

Maybe I miss a configuration or something like this.

Regards,
Maxime

Petar Sapunar

unread,
Sep 28, 2020, 8:52:49 AM9/28/20
to mapstor...@googlegroups.com
Hello. Did u try deleting browser history. These problems are often just result of cache not clearing.

--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.
Message has been deleted

Maxime Gourlay

unread,
Sep 28, 2020, 9:05:48 AM9/28/20
to mapstore-users

Hello,

I've just tried deleting the browser history, still not working unfortunately.

The docker installation is fresh, I follow it from this page "https://docs.georchestra.geo-solutions.it/fr/latest/georchestra_integration/"
I didn't touch the datadir folder (everyhting is initialized by the installation).


Message has been deleted

Lorenzo Natali

unread,
Sep 29, 2020, 5:22:29 AM9/29/20
to mapstore-users
Hi,
I tried it (latest master) and it works for my installation. It's not so fresh, but the things should be the same.
If you can see installation correct, and the extension listed, it should be present on the server (datadir should contain some extra-files to handle it).
Did you try to create a context with only the extension and open it?

I link the zip I build that worked for me.


Jonathan Durand

unread,
Sep 30, 2020, 1:30:21 AM9/30/20
to mapstore-users
Hi everybody,

Thank a lot for all your reply.
I managed to get the Sample extension to work ! (yeah!)

I still have some question :
1) Mapstore2-georchestra on Docker (geosolutionsit/mapstore2-georchestra) with a datadir (like this doc) : this is a MapStore2 product or a MapStore2 project ?

If I understand correctly, this is a MapStore project. So:
2) Can I add a "homemade" plugin in my MapStore2-georechstra (docker) datadir ?
I succeeded to make a plugin with this doc (developer-guide/plugins-howto/) in my MapStore2 developer project (with the createProject.js script).
But datadir seems different. I can override localConfig.json file or with the patch file like in this doc (externalized-configuration) (my locaConfig.json file is in the root of mapStore datadir).
But Where i write the plugins.js config and the Sample.jsx files ? I need to write the app.jsx (if I understand well, no, I don't) ?

3) Can be load an extension on every mapsore map, also on the "home map" (https://georchestra.mydomain.org/mapstore/#/) like a plugin ?

Thank a lor for your time and help.
I will continue to read the doc and make some test.

Lorenzo Natali

unread,
Sep 30, 2020, 5:01:13 AM9/30/20
to mapstor...@googlegroups.com
Hi, good to know. I replied your questions inline, hope it helps

Il giorno mer 30 set 2020 alle ore 07:30 Jonathan Durand <durandj...@gmail.com> ha scritto:
Hi everybody,

Thank a lot for all your reply.
I managed to get the Sample extension to work ! (yeah!)

I still have some question :
1) Mapstore2-georchestra on Docker (geosolutionsit/mapstore2-georchestra) with a datadir (like this doc) : this is a MapStore2 product or a MapStore2 project ?

It's a MapStore project. Datadir support for MapStore exists for projects 
If I understand correctly, this is a MapStore project. So:
2) Can I add a "homemade" plugin in my MapStore2-georechstra (docker) datadir ?
I succeeded to make a plugin with this doc (developer-guide/plugins-howto/) in my MapStore2 developer project (with the createProject.js script).
But datadir seems different. I can override localConfig.json file or with the patch file like in this doc (externalized-configuration) (my locaConfig.json file is in the root of mapStore datadir).
But Where i write the plugins.js config and the Sample.jsx files ? I need to write the app.jsx (if I understand well, no, I don't) ?

This is an interesting solution. Theoretically you can. You will have to add the files of your extension to the data-dir as well as the upload tool could do. 
There are several scenarios you can support with patch files and multiple-data dir.
This PR on geOrchestra doc will clarify more the role of each configuration file in geOrchestra data dir. 
This is a preview:


3) Can be load an extension on every mapsore map, also on the "home map" (https://georchestra.mydomain.org/mapstore/#/) like a plugin ?

Yes, the only difference is that, as well as you installed the extension, for the home map you have to edit localConfig.json (or create it in your data dir) or add a patch file in datadir that adds the plugin to the localConfig.json --> plugins --> desktop section.
For contexts you have the configuration tool. 

Thank a lor for your time and help.
I will continue to read the doc and make some test.



Le mardi 29 septembre 2020 à 11:22:29 UTC+2, lorenzo...@geo-solutions.it a écrit :
Hi,
I tried it (latest master) and it works for my installation. It's not so fresh, but the things should be the same.
If you can see installation correct, and the extension listed, it should be present on the server (datadir should contain some extra-files to handle it).
Did you try to create a context with only the extension and open it?

I link the zip I build that worked for me.


--
You received this message because you are subscribed to the Google Groups "mapstore-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapstore-user...@googlegroups.com.

==
GeoServer Professional Services from the experts! Visit http://goo.gl/it488V for more information.
==

Dott. Ing. Lorenzo Natali
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054  Massarosa (LU)
Italy

phone: +39 0584 962313
fax:      +39 0584 1660272

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

Jonathan Durand

unread,
Oct 12, 2020, 11:12:02 AM10/12/20
to mapstore-users
Hi,

1) Plugin system on official Docker mapstore2-georchestra
I think I was not clear. Can I add a Plugin (not an extension) in my Docker mapstore2-georchestra Datadir ? 
Without recompile WAR file ?

2) Extension system bug ?
In the other hand, we have make some extension tests :
You can find 2 tests here : wetransfer-extension
The difference between the "wrokingExtension.zip" and "notWorkingEtension.zip" is the line : 
n("./node_modules/w3c-schemas/w3c-schemas.js").XLink_1_0;
If I run  `npm run run-extension` will work perfectly and display my "console.log", but when it is builded, there is no extension display and no errors anywhere.
Can you help us ?

We find the plugin system more simple instead of Extension, but we can't get it work !

Thank for all your help

Lorenzo Natali

unread,
Oct 19, 2020, 10:05:39 AM10/19/20
to mapstore-users
I reply you inline

Il giorno lunedì 12 ottobre 2020 alle 17:12:02 UTC+2 durandj...@gmail.com ha scritto:
Hi,

1) Plugin system on official Docker mapstore2-georchestra
I think I was not clear. Can I add a Plugin (not an extension) in my Docker mapstore2-georchestra Datadir ? 
Without recompile WAR file ?

No, extensions are born to provide this possibility. Once installed, you can use the extension's plugin everywhere, even in the main map.
2) Extension system bug ?
In the other hand, we have make some extension tests :
You can find 2 tests here : wetransfer-extension
The difference between the "wrokingExtension.zip" and "notWorkingEtension.zip" is the line : 
n("./node_modules/w3c-schemas/w3c-schemas.js").XLink_1_0;
If I run  `npm run run-extension` will work perfectly and display my "console.log", but when it is builded, there is no extension display and no errors anywhere.
Can you help us ?
I noticed during my work that sometimes the extensions, even when installed, fail without logging the error. I opened an issue about this here:

I noticed that these issues are caused by some imports that are not resolved correctly. In your case it looks like you are trying is trying to import a lib (w3c-schemas) that is used in MapStore. If I remember well they are included by some modules of utils/ogc/.

I don't see the real code in your extension so I can't figure out how you are importing them, but I suggest you to not use that lib directly because:
 - we are going to deprecated it soon
-  they are not loaded on startup (so maybe this can cause your problem)

Probably removing some import will make your extension work. Future versions of MapStore that do not include w3c-schemas lib may allow to use that utils also from an extension.

We find the plugin system more simple instead of Extension, but we can't get it work !

Yes plugins are simpler, but to load them dynamically in an installed environment, you need the support provided by extensions.
Reply all
Reply to author
Forward
0 new messages