Magnolia CMS Modules

by Devexperts

Child pages
  • dx-sync-module

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Specify DxModuleVersionHandler as a base class of your module version handler 
  2. Pass folder where your module is placed as a parameter to the DxModuleVersionHanlder constructor.
  3. Specify resources which need synchronization in your module version handler constuctor.

For example:

Code Block
super("web-devspace");
keepUpToDateResources("/mgnl-files", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.MGNL_FILE);
keepUpToDateResources("/abc/img", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.DMS_FILE);
keepUpToDateResources("/abc/themes/img", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.DMS_FILE);
keepUpToDateResources("/dev/docs", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.DMS_FILE);
keepUpToDateResources("/abc/js", Scope.FOLDER_ONLY, ResourceType.RESOURCE_PROCESSED_JS);
keepUpToDateResources("/abc/js", Scope.SUBFOLDERS_ONLY, ResourceType.RESOURCE_JS);
keepUpToDateResources("/abc/themes/abc/css", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.RESOURCE_PROCESSED_CSS);
keepUpToDateResources("/abc/emails", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.TEMPLATE);
keepUpToDateResources("/abc/paragraphs", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.TEMPLATE);
keepUpToDateResources("/abc/templates", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.TEMPLATE);
keepUpToDateResources("/search-module/templates", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.TEMPLATE);
keepUpToDateResources("/abc/groovy", Scope.FOLDER_AND_SUBFOLDERS, ResourceType.GROOVY_SCRIPT);

 

File-based configuration

You can specify which files are to be synchronized in a configuration file.
Synchronization is performed on a directory basis. Each directory that is needed synchronization should be listed in the configuration file.

...