enonic / xp

Enonic XP
https://enonic.com
GNU General Public License v3.0
201 stars 34 forks source link

Import-Export js lib #7196

Closed ComLock closed 3 years ago

ComLock commented 5 years ago

In order to make a backup of a repo before syncing new data to it, it would be nice to be able to run export from js.

Perhaps also make it possible to "rollback" by exposing lib-repo.import()?

To do that one might need some listExports function which param to filter on repo and perhaps branch.

This is a better solution thou: https://github.com/enonic/xp/issues/7190

sigdestad commented 4 years ago

Have to conclude if this is content lib, or repo lib. Otherwise this should be exposed. This will also eliminate the need for using Java to import stuff, like we do in Superhero.

This task needs to fix both export and import.

rymsha commented 3 years ago

Question about which library it belongs to arises to often. Shot answe: It must be a separate core lib-export. There is a module core-export with its central service ExportService. It contains two methods importNodes exportNodes

Node API doesn't know anything about export format, so lib-node would have to depend on core-export, and it would be a bad design known as tight coupling.

Module name may be confusing, but may make sense after a second thought: it allows to work with "exports" (export as nown here). This service creates an export and can also import an export. If still not convinced take it as a historical reason - it is too much hassle to change public API.

rymsha commented 3 years ago

Documentation note: This Epic also brings ability to configure exports folder.