Skip to content

Commit 06a02f3

Browse files
STAND-122: Display OpenMRS Platform Version in Standalone App Window (#79)
* move Demo and CIEL Database Packaging from Build-Time to Runtime * fixing test failures * adding support for mysqldump via MySQL on CI * removing the wildcard* * addressing linux and win install mysql * finding mysqldump on ci * revert to mysqldump * adding ci linux mysqldump checks * adding arg column-statistics=0 to pass the linux build * cleanup and updating README.md * adding cleaning step for linux * using bin/mariadb-dump instead of mysqldump * using bin/mariadb-dump instead of mysqldump * using scripts to solve mysqldump for windows * using java DatabaseDumper to solve mysqldump for windows * adding skip-extended-insert * added rebuild the search index on database * fixing windows ci failure * fixing windows ci failure * addressing the mvn package failure * re-correcting the update search index * STAND-122: Display OpenMRS Platform Version in Standalone App Window * STAND-122: Display OpenMRS Platform Version in Standalone App Window * Improving to the industrial branding standard * Remove .DS_Store files and add to .gitignore
1 parent 911e40c commit 06a02f3

File tree

8 files changed

+35
-4
lines changed

8 files changed

+35
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ local.properties
3636

3737
# Locally stored "Eclipse launch configurations"
3838
*.launch
39+
.DS_Store
3940

4041
# CDT-specific
4142
.cproject

pom.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@
109109

110110
<build>
111111
<finalName>openmrs-standalone-${openmrs.version}</finalName>
112+
<resources>
113+
<resource>
114+
<directory>src/main/resources</directory>
115+
<filtering>false</filtering>
116+
</resource>
117+
<resource>
118+
<directory>src/main/resources-filtered</directory>
119+
<filtering>true</filtering>
120+
</resource>
121+
</resources>
122+
112123
<plugins>
113124
<plugin>
114125
<groupId>org.apache.maven.plugins</groupId>

src/main/java/org/openmrs/standalone/ApplicationController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public static void main(String[] args) throws Exception {
7676
if (properties != null) {
7777
tomcatPort = properties.getProperty("tomcatport");
7878
}
79+
80+
OpenmrsUtil.PLATFORM_VERSION = StandaloneUtil.getPlatformVersion();
7981

8082
//Some users may prefer command line to having the GUI, by providing the -commandline switch.
8183
//Command line args can always override the values in the runtime properties file.

src/main/java/org/openmrs/standalone/MainFrame.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public void run() {
542542
* @see org.openmrs.standalone.UserInterface#showInitialConfig()
543543
*/
544544
public void showInitialConfig() {
545-
final JDialog configDialog = new JDialog(this, "Configure your OpenMRS Installation", true);
545+
final JDialog configDialog = new JDialog(this, "Configure your OpenMRS Platform "+ OpenmrsUtil.PLATFORM_VERSION +" Installation", true);
546546
JPanel content = new JPanel();
547547
content.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
548548
content.setLayout(new BorderLayout(10, 10)); //10,10 = hgap, vgap
@@ -563,7 +563,7 @@ public void showInitialConfig() {
563563
colorHelper(emptyDatabase, new Color(255, 243, 136));
564564

565565
final JButton expertMode = new JButton(
566-
"<html><h3>Expert Mode</h3>Go through the initial setup wizard yourself. You will add all content, including dictionary concepts, to the system after it is running.</html>",
566+
"<html><h3>Expert Mode</h3>Go through the initial setup wizard yourself. You will add all content, including dictionary concepts, to the system of Openmrs after it is running.</html>",
567567
new ImageIcon(getClass().getResource("expert.png")));
568568
colorHelper(expertMode, new Color(255, 138, 138));
569569

@@ -597,7 +597,7 @@ public void actionPerformed(ActionEvent e) {
597597
}
598598

599599
JLabel instructions = new JLabel(
600-
"<html><b>Welcome to OpenMRS! OpenMRS can be configured in one of " + buttonList.size() + " ways, depending on your needs. Please click on the configuration that best meets your needs.</b><br/>(You will not see this next time you run OpenMRS)</html>");
600+
"<html><b>Welcome to OpenMRS Platform "+ OpenmrsUtil.PLATFORM_VERSION +"! OpenMRS can be configured in one of " + buttonList.size() + " ways, depending on your needs. Please click on the configuration that best meets your needs.</b><br/>(You will not see this next time you run OpenMRS)</html>");
601601
instructions.setFont(font);
602602

603603
JButton exitButton = new JButton("Exit");

src/main/java/org/openmrs/standalone/OpenmrsUtil.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import java.util.Properties;
3232

3333
public class OpenmrsUtil {
34+
35+
public static String PLATFORM_VERSION;
3436

3537
private static final String OPERATING_SYSTEM_KEY = "os.name";
3638

@@ -252,4 +254,8 @@ public static String findDumpExecutable(String baseDir, String dbDir) {
252254
}
253255
}
254256

257+
public static String getTitle() {
258+
return "OpenMRS Platform " + PLATFORM_VERSION + " Standalone";
259+
}
260+
255261
}

src/main/java/org/openmrs/standalone/StandaloneUtil.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,4 +531,14 @@ public static String setRuntimePropertiesFileMysqlAndTomcatPorts(String mariaDBP
531531

532532
return mariaDBPort;
533533
}
534+
535+
public static String getPlatformVersion() {
536+
Properties properties = new Properties();
537+
try (InputStream inputStream = StandaloneUtil.class.getResourceAsStream("/org/openmrs/standalone/standalone.properties")){
538+
properties.load(inputStream);
539+
} catch (IOException e) {
540+
throw new RuntimeException(e);
541+
}
542+
return (String) properties.get("openmrs.version");
543+
}
534544
}

src/main/java/org/openmrs/standalone/UserInterface.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
public interface UserInterface {
2121

22-
public static final String TITLE = "OpenMRS Standalone";
22+
public static final String TITLE = "OpenMRS Platform "+ OpenmrsUtil.PLATFORM_VERSION +" Standalone";
2323

2424
public static final int DEFAULT_TOMCAT_PORT = 8088;
2525

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
openmrs.version=${openmrs.version}

0 commit comments

Comments
 (0)