Data import and export for a plain Zope application

The company I work for plans to introduce a new CRM, which needs to be connected/synced to my Zope app, which also stores customer and additionally, product data.

The CRM brings along a "data integration server", which usually directly accesses another systems db, or may handle csv or xml .. or (expensive) custom solutions.

While Plone offers plone.rest and plone.restapi, can anybody throw in some ideas how to go with plain Zope?

The data exchange ideally would go both ways and is not a one time import, but used ad hoc.

As I am not keen in re-implementing REST on top of Zope on my own, my current's strategy would be a Flask server put in front of Zope. Flask would handle the data transfer e.g. via REST and talks to Zope via XML-RPC. This is my first gut feeling.

Any reasons why this would be a bad idea or any better ideas?

Thanks!

You might find dm.zope.rpc interesting. It allows to use Zope scripts via various RPC protocols.

I have just noticed that I have not yet ported it to Zope 4. The required changes are likely small.

Not sure if this idea is too convoluted or far-fetched for your purpose.

Our use cases are to transform incoming/outgoing EDI messages to/from a fixed-length format used by an ancient ERP "solution" (ehrm...) and csv <--> fixed-length polling files used in shipping. For this, we have implemented connectors using BOTS.

The BOTS documentation is very much EDI oriented, but the package itself is much more versatile. See for example https://bots-edi.github.io/bots/configuration/channel/standard-comms.html

In practice, you define an inbound and an outbound channel (or chains) and assign those to a specific route. I could imagine that your new CRM spits out data in a predefined open format, which could then be converted via BOTS to connect to Zope over XML-RPC?

So, I am a big fan of plone.rest but its depends on CMFCore - it is probably possible to get rid of the dep. plone.rest itself offers only the library to build restful endpoints in a super easy way - it does not depend on Plone. plone.restapi is in fact really plone. It's an almost complete API for Plone (including most settings and admin) and turns Plone into an headless CMS.

Zope's XMLRPC is to some degree helpful. I used it in past and with success, but not what someone nowadays would invent.

First, I would ask myself what data is needed to sync and then develop a strategy. IIRC in your case most data is in SQL DB's anyway? Maybe there are more possibilities?

Thanks for all the replies!

@jensens The dependency on Products.CMFCore is no problem, as my app already uses it.

The project start just was delayed for a couple of months, but then I can reason about these different approaches!

Thanks again!