Magnolia CMS Modules

by Devexperts

Child pages
  • dx-sync-module

Versions Compared

Key

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

...

It allows to edit templates scripts, CSS, JavaScript and other files directly from IDE or editor of your choice. Changes are instantly propagated to Magnolia repositories of a running Magnolia instance.
So you can preview your changes on the website as soon as you save your files.
Creating, updating, deleting and renaming files operations are supported. 

Content

Table of Contents
excludeContent

...

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);

...

DxModuleVersionHandler may work in 2 modes.

  • Development mode.
    This mode is in use when -DdevPlatform=true JVM argument is specified. In this case all changes in source files are instantly propagated to the running Magnolia CMS.
  • Production mode.
    This mode is used by default. All resources are synchronized on module start up using usual Magnolia tasks.
    Note: you don't need jnotify library in Production mode.
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.

...