Liferay provides powerful visual tools to create pages from fragments and widgets. That includes Content Pages, Display Pages and Page Templates. Once those pages are created it is often needed to export them so that they can be distributed or moved to a different site or environment, where they can be imported. Furthermore the export format should be open, allowing checking it into a source control system or even enabling developers to author fragment-based pages declaratively, make modifications to exported pages and validate the result before importing them.
The goal of this story is to solve this need by introducing a new format and an export mechanism everywhere there is a fragment based page. The suggested format is a JSON format (with an associated JSON schema). This format should be decoupled from the internal implementation so that we can ensure that it will still work in future versions of Liferay.
The fragment-based page definition file should contain all the information necessary to reproduce the page or page template. That includes the page structure, fragments, widgets and their configuration. The references to the fragments should use external codes and not internal ids, so that if the fragments have themselves been exported and imported into a new system, the reference will still work.
The Fragment Toolkit should support authoring the fragment-page JSON file.
Note: Consider supporting including the fragment-page JSON file inside the fragments ZIP file so that they can all be imported at once.