With the moduleEditor module, file-based modules (i.e. modules that do not contain Java or other code that requires compilation) can be loaded and updated on a production server using the user interface without needing to start and stop the server. This feature makes it easier to update queries, reports, and views that can be maintained through a file based module.
Create a file based module containing the resources needed. Typically you would create your module on a development machine, and build it, generating a file named [MODULE_NAME].module. To load the content via this process, the name of the .module file needs to be all lower case.
If you would like a small module to test this feature as shown in the walkthrough on this page, download:
On your LabKey Server, add your new module by name as follows. You must be a site admin or have the Platform Developer role to add modules, and this feature is only supported for servers running in production mode.
You will now see your module listed. Notice the module type shown is "SimpleModule". At this point the module is empty (an empty .modules file has been created as a placeholder for your content).
Next, use the reloading mechanism described in the next section to replace this empty module with your content.
To load the module on the server, use Upload Module from the module details page of the admin console. Note that you do this to populate an empty module as well as to reload it to pick up content you've changed outside the server in the future.
Now your module can be enabled and used on your server.
Without starting and stopping the server, your module is now available and the resources can be used whereever you enable the module. If you are using our loading demo module and choose to use it in a folder containing the example study downloadable from this page, you will be able to use a few additional module resources.
Navigate to the folder where you want to use the resources it contains and enable it:
To edit the module-based resources, you must make changes using a development machine (or elsewhere on your filesystem), then regenerate the revised .module file and then use the Upload Module link on the module details page to reload the new content.
On the Module Details page, on the right side of the row for your module, there are links to:
Note that feature is intended for use on a production server, and will only succeed for modules that do not contain Java code or require compilation.
If you see the error message "Archive should not contain java code" and believe that your module does not contain such code, one or more of the following may help you build a module you can load:
1. The module.properties file should contain the line:
ModuleClass: org.labkey.api.module.SimpleModule
2. If there is a build.gradle file in your module, it must contain the line:
apply plugin: 'org.labkey.fileModule'
plugins {
id 'org.labkey.build.fileModule'
}
3. If your module is located in the "$LABKEY_HOME/server/modules" directory, our tools will attempt to build it. Try moving it to "$LABKEY_HOME/server/localModules" instead, add a build.gradle file, and then include it in your settings.gradle file:
include ':server:localModules:myModule'
Note: If your module does not contain any Java source code, avoid using a directory named "src".