|
|
OverviewTo create a customized version of Onyx, you use the onyx-demo application as a starting point. You can modify various aspects of the global Onyx configuration to suit your study's needs, build one or more custom questionnaires, define custom physical measurement and sample collection stages, and then generate a war file so it can be deployed on a server.
Copying the onyx-demo ProjectThe first step in creating a customized version of Onyx is to copy the onyx-demo project as and rename it for your study. You will modify the configuration as explained in this guide. Onyx ConfigurationThe WEB-INF/config directory (for customizers)Most of the customization and configuration changes you will make, will be done in the following directory of your project: src/main/webapp/WEB-INF/config Throughout this guide, we refer to this directory as your WEB-INF/config directory. The WEB-INF/config directory (for installers)If you are looking at this guide after installing a custom version of Onyx, your WEB-INF/config directory is under the Tomcat home directory: $TOMCAT_HOME/webapps/custom-onyx/WEB-INF/config Onyx Configuration FilesMost Onyx configuration is done in files located in the WEB-INF/config directory and its subdirectories. Most global parameters are set in the onyx-config.properties file which is directly in WEB-INF/config. Changing the Database SettingsThe database settings are specified at the end of the onyx-config.properties file. If necessary, you can change these settings as indicated in this table.
Configuring Participant RecuitmentOnyx supports two ways of recruiting participants: ENROLLED (participants who have appointments) and VOLUNTEER (participants without appointments, also known as "walk-ins"). Onyx can be configured to accept either recruitment type or both. This is set near the top of the onyx-config.properties file. WEB-INF/config/onyx-config.properties Configuring Participant AttributesOnyx collects data about people who agree to participate in a study. These people are called "participants". Built-in participant attributesOnyx includes the following attributes for all participants. These attributes can be customized as explained below:
Defining the format of the Participant ID (optional)You can define a validation pattern for the Participant ID attribute in the following section of the onyx-config.properties file. WEB-INF/config/onyx-config.properties The default pattern (.*) means any value would be accepted. For detailed information about the defining a validation pattern, see JavaPattern. Customizing participant attributesParticipant attributes can be customized in the participant-attributes.xml file in WEB-INF/config. In this file, you can redefine the built-in attributes and declare new attributes. A new attribute can be declared using the following schema:
For example, these are the custom attributes of participants defined for the onyx-demo application: WEB-INF/config/participant-attributes.xml To localize the names of participant attributesThe names of participant attributes can be localized in the{{ messages_*.properties }}files in }}{{ WEB-INF/config. For onyx-demo, English and French properties files are provided. To validate participant attributesYou can define patternValidator which will validate the value entered based on a regular expression as specified in JavaPattern. The range validator is able to check that the participant value is in a range of numerical values (INTEGER, DECIMAL), dates (DATE) or text length (TEXT). Upper and lower bound can be provided individually or both. Allowed date formats for date bounds are:
Here are some examples of how to configure range validators: Defining Custom VariablesYou can define custom variables in a file called custom-variables.xml file in WEB-INF/config. Here are some reasons you might want to define a custom variable:
For information on how to define a script, see Magma Javascript API. WEB-INF/config/custom-variables.xml Configuring the Appointment listOnyx imports participant appointments from a file (generated by some other programme). The file can be in Excel or XML format. Defining input and output directories for the appointment listYou must define the input directory where Onyx will look for the appointment list file. Defining an output directory is optional. When updating the appointment list, the user can select a file. If they don't, Onyx will process whatever XML or Excel (.XSL) file it finds in the input directory. WEB-INF/config/onyx-config.properties Configuring the appointment list readerThe appointment list file is read by a ParticipantReader class. You set a number of lines in the onyx-config.properties file to define what the reader class should look for in the appointment file. See the table below for an explanation of the attributes related to the participant reader. See also the Excel example and the XML example.
Example Excel appointment listFor an Excel format appointment list that looks like this (click on the thumbnail below)... ...the participant reader attributes would be set as follows in onyx-config.properties: WEB-INF/config/onyx-config.properties (Excel format appointment list) Example XML appointment listFor an XML format appointment list that looks like this... ...the participant reader attributes would be set as follows in onyx-config.properties: WEB-INF/config/onyx-config.properties (XML format appointment list) Scheduling automatic updates of the appointment listEdit the following line in the onyx-config.properties file: WEB-INF/config/onyx-config.properties The above configuration ("0 0 4 * * ?") means that the appointment list will be updated every day at 4:00 a.m. To disable automatic updates, simply leave the property blank, as follows: For details of the syntax to use, see http://quartz.sourceforge.net/javadoc/org/quartz/CronTrigger.html. Modifying Date and Time FormatsYou can edit the data and time formats that will be used throughout Onyx by editing these lines in the onyx-config.properties file: WEB-INF/config/onyx-config.properties Modifying the PrinterOn startup, Onyx decides which printer to use for printing reports for participants. Onyx will try to find a printer with a particular name. If that printer does not exist, or does not support PS printing, then it will fallback to using the system's default printer. If that printer does not support PS printing, then printing reports from Onyx will not be possible. You can change the printer to look up at startup:
|
Search Onyx Documentation |
Customizing the Global Configuration
Labels:
None