SDK and ui framework - workflow ?

Hello, I am sorry if that is described somewhere, please then refer me … thank you!

I am trying the SDK following with Ubuntu (well, elementary OS …) - Java 8

  • it works, also can create the module
  • and the module is visible and can be accessed via web

now, I am trying

as I want to create a form to entry data, and add it somewhere to the ‘visit’ (doctor role) page

  • i am changing the groovy (gsp), but, I cannot achieve a change (hm, btw, where is it deployed?)

my question is, actually, the workflow … maybe my config is not-good. I thought I can do:

1/ using the SDK do create a module (that will run on ref app 2.4)

  • it worked

2/ changing the module (the file structure that the SDK created)

  • compiling it (if needed), and deploying it … mvn openmrs-sdk:deploy -DserverId=[myServerId] – it does not work, crashes/blocks

3/ another try: creating a module, changing it,

  • restarting the server, with the changed module mvn clean install openmrs-sdk:run – works but the ‘former’ module is shown

… my question is, is this ‘the way’ to do it at all, is this the uiframework to use … ah, I don’t want to use this pure-html ui framework … so I am asking before I start to dig into it more, i would be glad about advice

Thank you

Hey @bci!

It should work, could you please run this command with -e (like mvn openmrs-sdk:deploy -DserverId=[myServerId] -e and share logs with us?

By the way, I guess you should use mvn openmrs-sdk:watch, see

Hi @gutkowski, Thank you very much for your quick reply.

Thank you also for confirming the work flow, that’s great if that’s ok.

1/ it works now. Issue might have been, that I had created more than 1 server. After deleting the others (having only 1 server left), I could see the change of the gsp page.

  • may I please ask, is there a possibility to see, which server is ‘active’ ? (well, minor, since if only one server is there, it’s no issue)

2/ as to the ‘watch’ function: using it, changing the file (in the folder structure … not on root/openmrs/ … modules/pages/ … gsp); refreshing the browser, the change is not visible.

  • may I have to change the file in the root/ … pages/ … mean: change omod to jar. Unpack jar. change the gsp. creating a jar again … seems a lot of effort :slight_smile:

Thank you very much for your help. So, I am kindly asking for the work flow of the ‘watch’ function now … :slight_smile:

3/ the java version. having java 8, It reminds that java 1.7 is recommended (selecting reference application 2.4).

  • may I rather switch to java 7? my desired setup would be: the reference application 2.4, and self-developed modules (in java 7 or 8, recommended was java 8, that was the reason that I am using java 8 now)

4/ error messages: ‘all times’ that I am trying: starting the server, create/build/deploy the module, log-in as admin, administration, advanced admin, selecting the module … this comes: org.openmrs.api.APIAuthenticationException: Privileges required: Get Users

5/ error messages 2: besides, it’s a very long log file. could you please tell me, which messages I might have a look at/take care for? Thank you very much

6/ intended use: adding a form to the visit-observation page may I ask if it’s possible to build a form with the sdk, that can be ‘added’ to the visit-observation page? … this example is building a GUI for the admin/core so it seems (I understood correctly?) if so, could you please give me advice/a link … how to do it?

Thank you very much!

No problem!

Ad 1. You can have as many servers as you want, but you have to deploy to server you are running at the moment to see changes.

Ad 2. Maybe I will describe you using watch step by step:

  1. Go to module project base directory, run   mvn openmrs-sdk:watch and select server you want to use
  2. Run server you selected in (1) with  mvn openmrs-sdk:run
  3. change anything in .gsp file
  4. See changes in web browser

I just did it a couple minutes ago and everything worked fine. Before doing this, ensure you have latest version of SDK by running mvn openmrs-sdk:setup-sdk -U

Ad 3. Yes, it is recommended to run Reference Application 2.4 with JDK 1.7 because it is based on OpenMRS Platform 1.11.6. Java 8 is required to work with OpenMRS platform 2.x

Ad 4 and 5 - please use and share logs with us, I can’t help you without it.

Ad 6. SDK doesn’t have this feature. I am afraid I don’t have enough experience with developing in UI framework to help you with this.

1 Like

Hi @gutkowski Thank you very much for your answer, repeating the steps, it worked. Thank you, great!

Thank you also for your all other answers.


Hello, Does this work for page, fragment controllers?

Yes, it does! The thing is the class need to be recompiled by your IDE. If you are using Eclipse, it happens automatically with every change you make, if you use IntelliJ then you need to hit ctrl + shift + 9 or configure it to do it automatically, see