File-based modules (i.e. modules that do not contain Java or other code needing compliation) can be loaded and updated on a production server by an administrator using the user interface without needing to start and stop. 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.
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.
You will now see your module listed. Notice the module type shown is "SimpleModule". At this point the module is empty.
Next, use the reloading mechanism described in the next section to populate this empty module with your content.
To reload the module on the server, use Update Module from the module details page of the admin console. Note that you do this to populate an empty module as well as to load changed content 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 to be used. 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 Update 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, check the following:
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'
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, then include it in your settings.gradle file:
include ':server:localModules:myModule'
4. If your module does not contain any actual source code, but includes a "src" directory (for example, if you cloned our demo module available on GitHub then removed the java code), try renaming it to "notSource" or something else so that it is not viewed as needing compilation by our tools.