LoadingStrategy

A loading strategy tells Fonto how to build and update the DocumentsHierarchy from the loaded set of documents. It should be implemented for any kind of hierarchy that involves multiple documents.

The fontoxml-single-document-hierarchy add-on implements a loading strategy that provides a way to construct a hierarchy based on a single document, using XPath to define which parts to present as separate sheet frames.

The fontoxml-dita add-on implements a loading strategy for DITA map documents.

Register a custom loading strategy using InitialDocumentsManager#setLoadingStrategy in an install.js:

import initialDocumentsManager from 'fontoxml-remote-documents/src/initialDocumentsManager.js';

export default function install() {
	initialDocumentsManager.setLoadingStrategy({
		loadInitialDocuments: function(remoteDocumentIds) {
			...
		},
		unloadAllDocuments: function() {
			...
		},
		unloadDocument: function(documentId) {
			...
		},
		reloadDocument: function(documentId) {
			...
		},
		retryLoadingDocumentForHierarchyNode: function(hierarchyNode) {
			...
		}
	});
}

Learn more about the loading strategy properties here:

Learn more about implementing this for your own custom maps in our guide: "Configure hierarchical multi-document management".

Related links

Was this page helpful?