ArticyImport.h header

#include <ew/app/ArticyImport.h>

Namespace ew::app

Functions

ImportedManuscript ew::app::import::buildArticyDocuments(const QJsonObject &root, const QString &exportName)

Turns an articy:draft JSON export into an importable manuscript rooted at exportName.

articy's shape problem is different from the other two. Its export is essentially FLAT – a list of models, each carrying a Type and a Properties object, with the hierarchy expressed by each model naming its Parent rather than by nesting. So the work here is not discovering where content hides (as in Campfire) but REBUILDING A TREE FROM REFERENCES, and doing it without trusting that the file lists parents before children or that every parent named actually exists.

A model whose parent is missing from the export is attached to the root rather than dropped: a partial export is a normal thing to be handed, and an entity nobody can find is worse than one filed in the wrong place. A cycle cannot hang the import – a model that ends up as its own ancestor is reparented to the root, because a story tool should not be able to crash on a file.

Every scalar property is kept, the recognisable ones as title and body and the rest as labelled fields, for the reason the other two importers keep theirs: a property this code has never heard of is still something the author wrote.

Pure and deterministic given root. Documents are returned by pointer (content objects are non-copyable), root first, parents before children.

ImportedManuscript ew::app::import::importArticyJson(const QString &jsonPath)

Reads the articy:draft JSON export at jsonPath and imports it via buildArticyDocuments(), naming the root after the file.

Returns an empty result if the file is not readable or is not a JSON object.