Open vadimjustus opened 5 years ago
Hi @vadimjustus , Nice idea 👍 For the first version of this feature, we can simply dump needed content to var directory.
The working flow will be the following (for a brand new CMS content):
The export flow will provide an extensible points to be able to export 3rd-party information.
What do you think about this approach?
Hi @roma-glushko,
sounds like a good first approach. Let's do it this way.
Bonus
Probably also media files can be moved to the directory var/content_provisioning/media
including the subdirectory structure. Therefore Firegento\ContentProvisioning\Model\Config\Parser\Query\ FetchMediaFilesFromContent
to detect all necessary media files in given content.
Like discussed in last Hackathon. We will introduce following interfaces in order to execute content dumping to file system.
The strategy interface defines dumping strategy in order to be able to extend dumping process in different ways.
interface StrategyInterface
{
public function getTargetPath(): string;
}
Example strategies: ExportToModuleStrategy
, ExportToVarDirectoryStrategy
The export dumps the content by given strategy.
interface ExportInterface
{
public execute(StrategyInterface $strategy, EntryInterface $entry): void;
}
Idea In most cases developers create content on the local machine and copy the results from database to the
content_provisioning.xml
in their module. Automate this process would save time and reduce possible errors.Solution Create a CLI command, which "dumps" one dedicated CMS entry to the XML file.
Additional context It should be possible to define into which module the content should be dumped.