Closed ComLock closed 3 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.
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.
Documentation note: This Epic also brings ability to configure exports folder.
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