• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 17208175973

25 Aug 2025 12:00PM UTC coverage: 63.742% (+0.07%) from 63.671%
17208175973

push

github

ibacher
TRUNK-6395: Saner scheme for copying properties from the installation script (#5260)

0 of 2 new or added lines in 1 file covered. (0.0%)

697 existing lines in 13 files now uncovered.

22147 of 34745 relevant lines covered (63.74%)

0.64 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/web/src/main/java/org/openmrs/web/filter/initialization/InitializationWizardModel.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.web.filter.initialization;
11

12
import java.util.ArrayList;
13
import java.util.List;
14
import java.util.Properties;
15

16
import org.openmrs.util.OpenmrsConstants;
17
import org.openmrs.web.WebConstants;
18

19
/**
20
 * The {@link InitializationFilter} uses this model object to hold all properties that are edited by
21
 * the user in the wizard. All attributes on this model object are added to all templates rendered
22
 * by the {@link InitializationFilter}.
23
 */
UNCOV
24
public class InitializationWizardModel {
×
25
        
26
        // automatically given to the .vm files and used there
27
        public static final String HEADER_TEMPLATE = "org/openmrs/web/filter/initialization/header.vm";
28
        
29
        // automatically given to the .vm files and used there
30
        public static final String FOOTER_TEMPLATE = "org/openmrs/web/filter/initialization/footer.vm";
31
        
32
        // Values for installMethod field.
33
        public static final String INSTALL_METHOD_SIMPLE = "simple";
34
        
35
        public static final String INSTALL_METHOD_TESTING = "testing";
36
        
37
        public static final String INSTALL_METHOD_AUTO = "auto";
38
        
39
        // Default OpenMRS admin password set by the simple installation.
40
        public static final String ADMIN_DEFAULT_PASSWORD = "Admin123";
41
        
42
        /**
43
         * Default database name to use unless user specifies another in the wizard or they are creating
44
         * a test installation
45
         */
UNCOV
46
        public static final String DEFAULT_DATABASE_NAME = WebConstants.WEBAPP_NAME;
×
47
        
48
        /**
49
         * Records completed tasks and are displayed at the top of the page upon error
50
         */
UNCOV
51
        public List<String> workLog = new ArrayList<>();
×
52
        
53
        /**
54
         * Whether the runtime properties file could possible be created. (only read by the velocity
55
         * scripts)
56
         */
57
        
UNCOV
58
        public boolean canCreate = true;
×
59
        
60
        /**
61
         * Error message from not being able to create the runtime properties file (only read by the
62
         * velocity scripts)
63
         */
64
        
UNCOV
65
        public String cannotCreateErrorMessage = "";
×
66
        
67
        /**
68
         * Whether the runtime file can be edited (only read by the velocity scripts)
69
         */
70
        
UNCOV
71
        public boolean canWrite = true;
×
72
        
73
        /**
74
         * The location of the runtime properties file (only read by the velocity scripts)
75
         */
76
        
UNCOV
77
        public String runtimePropertiesPath = "";
×
78
        
UNCOV
79
        public String installMethod = INSTALL_METHOD_SIMPLE;
×
80
        
81
        /**
82
         * True/false marker for the question "Do you currently have an OpenMRS database installed"
83
         */
UNCOV
84
        public Boolean hasCurrentOpenmrsDatabase = true;
×
85
        
86
        /**
87
         * True/false marker for the
88
         * question"Do you currently have a database user other than root that has read/write access"
89
         */
UNCOV
90
        public Boolean hasCurrentDatabaseUser = true;
×
91
        
92
        /**
93
         * Filled out by the user on the databasesetup.vm page
94
         */
UNCOV
95
        public String databaseName = DEFAULT_DATABASE_NAME;
×
96
        
97
        /**
98
         * Filled out by user on the databasesetup.vm page Looks like:
99
         */
UNCOV
100
        public String databaseConnection = "jdbc:mysql://localhost:3306/@DBNAME@?autoReconnect=true&sessionVariables=default_storage_engine=InnoDB&useUnicode=true&characterEncoding=UTF-8";
×
101
        
102
        /**
103
         * Optional Database Driver string filled in on databasesetup.vm
104
         */
UNCOV
105
        public String databaseDriver = "";
×
106
        
107
        /**
108
         * MySQL root account password used for simple installation. Filled in simplesetup.vm.
109
         */
UNCOV
110
        public String databaseRootPassword = "";
×
111
        
112
        /**
113
         * Filled in on databasesetup.vm
114
         */
UNCOV
115
        public String createDatabaseUsername = "root";
×
116
        
117
        /**
118
         * Filled in on databasesetup.vm
119
         */
UNCOV
120
        public String createDatabasePassword = "";
×
121
        
122
        /**
123
         * DB user that can create an openmrs db user Filled in on databasetablesanduser.vm
124
         */
UNCOV
125
        public String createUserUsername = "root";
×
126
        
127
        /**
128
         * DB user that can create an openmrs db user Filled in on databasetablesanduser.vm
129
         */
UNCOV
130
        public String createUserPassword = "";
×
131
        
132
        /**
133
         * The username of a user that exists that can read/write to openmrs. Entered on
134
         * databasetablesanduser page
135
         */
UNCOV
136
        public String currentDatabaseUsername = "";
×
137
        
138
        /**
139
         * The password of a user that exists that can read/write to openmrs. Entered on
140
         * databasetablesanduser page
141
         */
UNCOV
142
        public String currentDatabasePassword = "";
×
143
        
144
        /**
145
         * Asked for on the databasetablesanduser.vm page to know if their existing database has the
146
         * tables or not
147
         */
UNCOV
148
        public boolean createTables = false;
×
149
        
150
        /**
151
         * if the user asked us to create the user for openmrs
152
         */
UNCOV
153
        public boolean createDatabaseUser = false;
×
154
        
155
        /**
156
         * Enables importing test data from the remote server
157
         */
UNCOV
158
        public boolean importTestData = false;
×
159
        
160
        /**
161
         * Does the user want to add the demo data to the database?
162
         */
UNCOV
163
        public boolean addDemoData = false;
×
164
        
165
        /**
166
         * Asked for on the otherproperties.vm page to know if the allow_web_admin runtime property is
167
         * true/false
168
         */
UNCOV
169
        public boolean moduleWebAdmin = true;
×
170
        
171
        /**
172
         * Asked for on otherproperties.vm page to know if the runtime property for auto updating their
173
         * db is true/false
174
         */
UNCOV
175
        public boolean autoUpdateDatabase = Boolean.FALSE;
×
176
        
177
        /**
178
         * Password for the admin user if the database was created now
179
         */
UNCOV
180
        public String adminUserPassword = ADMIN_DEFAULT_PASSWORD;
×
181
        
182
        /**
183
         * Implementation name.
184
         */
UNCOV
185
        public String implementationIdName = "";
×
186
        
187
        /**
188
         * Implementation ID.
189
         */
UNCOV
190
        public String implementationId = "";
×
191
        
192
        /**
193
         * Pass phrase used to validate who uses your implementation ID.
194
         */
UNCOV
195
        public String implementationIdPassPhrase = "";
×
196
        
197
        /**
198
         * Text describing the implementation.
199
         */
UNCOV
200
        public String implementationIdDescription = "";
×
201
        
UNCOV
202
        public String setupPageUrl = WebConstants.SETUP_PAGE_URL;
×
203
        
204
        /**
205
         * The tasks to be executed that the user selected from the wizard's prompts
206
         */
207
        public List<WizardTask> tasksToExecute;
208
        
UNCOV
209
        public String localeToSave = "";
×
210
        
211
        /**
212
         * The url to the remote system
213
         */
UNCOV
214
        public String remoteUrl = "";
×
215
        
216
        /**
217
         * The username to use to authenticate to the remote system
218
         */
UNCOV
219
        public String remoteUsername = "";
×
220
        
221
        /**
222
         * The password to use to authenticate to the remote system
223
         */
UNCOV
224
        public String remotePassword = "";
×
225
        
226
        /**
227
         * The current step. e.g Step 1 of ...
228
         */
UNCOV
229
        public int currentStepNumber = 1;
×
230
        
231
        /**
232
         * The total number of steps. e.g Step ... of 5
233
         */
UNCOV
234
        public int numberOfSteps = 1;
×
235
        
UNCOV
236
        public Properties additionalPropertiesFromInstallationScript = new Properties();
×
237
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc