Scripting Module and Data Integrity Module enhancement
IRC Nick: k-joseph
Introduction or Project Overview:
OpenMRS is currently using the groovy Module, which was created to embed Groovy in OpenMRS and also to serve as the base module for other modules that want to use Groovy scripting too, unfortunately the module supports for only groovy written scripts, and so I very much appreciate that OpenMRS is planning through GSoC 2013 to have a scripting module that supports all or most scripting languages,
Am glad to be proposing for this project and my idea is to automatically support any JSR 223 -scripting complaint languages, I plan to do this by adding the JSR-223 jar archive file that comprises of the JSR-223 – complaint languages on the class-path thus including libraries for several of them.
JSR-223 provides support for scripting programming languages to the Java platform, and all these supported scripting languages are accessible through a standardized API, for JSR-223 as I illustrate below, and referenced at http://docs.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/
Having established the protocol that I will use to include other scripting languages, I then will here illustrate in much abstract and yet clear data flow diagram to supplement by idea. Referring to diagram 2.
Processing or Managing Scripts
I plan to manage the various scripts of the JSR-223 complaint languages by:
Invoking or processing a call to a service of the language, like;
Persisting and Retrieving Scripts to the OpenMRS database;
ScriptService scriptService = Context.getScriptService()
Script jsScript = scriptService.getScript(1);
Changing or modifying the script and persisting the changes to the OpenMRS database;
ScriptService scriptService = Context.getScriptService()
Script groovyScript = scriptService.getScript(1);
Since the Scripting module will add to the OpenMRS data model, then I will be creating DAOs and Services as I have mentioned that above under managing scripts.
See also in,
Am to implement a Script editor window that is very user friendly and allows;
creating and accessing several script files via tabs inside the main script window,
The user can create, run and manage scripts, via the icon based UI that am planning to implementation,
The Script name shall be accessed and changed or renamed by either clicking the Script name field or right clicking the script to rename under Scripts files and then selecting rename, among the several options like, execute/run, save as, save, edit etc that I plan to implement there,
When the use has typed in the script field, the script, he/she can run the script by clicking the run icon, and the script out put is displayed down under the Result field if all goes well, else there is a problem with the script being run, the scripting module generates an error log, under the Stack trace field, Consider the illustration below,
The user will be able to manage several scripts at the same time, I intend to either use css or tables to structure the manage Scripts page, I plan to have fields for script name, the user name who created the script, date when it was created, last modified by, date when modified, and Action.
For the case of the user, that is the currently signed in user, I will be applying Authentication and Authorization to fulfill this task, as illustrated at the wiki page
Under the Action field, I will be adding various actions, like delete for deleting that particular script in that same row, execute/run for opening the Script window in a new tab and running it, rename, clone script etc, as to how I will expand in my knowledge during the process, I will add all those actions in only one drop down box, Refer to the illustration below
I will be maintaining the openmrs page structure/ layout all over my added pages in this module task,
Notice that this is not the final plan I have for this project is concerned and I will be expanding in knowledge and learning new things that I may not as yet know from now.
Being open minded and receptive to new ideas will help me to be much more productive than I may have planned in this proposal, In case there is any thing any developer want me to add or change, I will be grateful to receive assistance on how I can perfect my proposal. Thanks very much.
Proposed Development Schedule:
12th, May – 19th, May – Getting familiarized with OpenMRS related projects such as data integrity module, groovy module etc and the Scripting API in wider coverage.
20th, May – May, 23rd – Research further on the requirements of the Scripting Module and preparing a design for the Scripting Module project.
17th, June – 12th, July – First phase of development or coding begins,
19th, June – Implementation for the Script Editor begins.
14th, July – Plan mid-term evaluation and submission.
15th, July – 28th, July – Write all the test cases for the first development stage.
29th, July – 1st, August – Begin on the Second phase of development, implementing managing Scripts capabilities.
2nd, – August – Mid-term evaluation deadline;
4th, August – 30th, August –Second phase of development.
1st, September– 13th, September – Conclude the second development phase.
15th, September – 20th, September – Documentation, code review and refactoring, Writing the remaining unit tests, and insuring that all tests pass.
23rd, September – Pencils down.
27th, September – Final Evaluation, begin submitting required code samples to goolge.
List of Deliverables:
The Scripting module in .omod format, upload the omod file to the Module repository.
The source code on github
OpenMRS wiki page technical document and user guide for the Scripting module.
1. Who are you? What are you studying?
I am KAWEESI JOSEPH, pursuing a bachelors degree in Software Engineering and Application Development at Bugema University located in Uganda, East Africa.
2. Please provide the URL to your wiki personal space. (If you don’t have one yet, please create one.)
My personal space is found at the url, https://wiki.openmrs.org/display/~k.joseph/Home
3. Why are you the right person for this task?
4. Do you have any other commitments we should know about?
I do not have any commitments for this summer, I have fully sacrificed it for my GsoC project, and in a period of at-most three weeks from now am getting my holidays where I have at-least three months just for my project preparation and implementation.
5. List your Java experience.
I have worked with Java for at-most a year and in that period i have written some applications, and still i have seriously worked on openmrs introductory and some module tickets for over 5 months,
6. List your web interface experience.
7. List any previous experience working with open source projects. (This experience is not a requirement.)
I began to work with open source with openmrs and indeed it has been one of my greatest experiences, seeing my code integrated into the openmrs-core upstream code bank, and all that I have so far experienced with open source project development is wow or a marvelous experience as I have worked with git, maven, among other tools within that period of time of at-least five months,
8. Please provide links to websites created by you and/or source code examples.
9. Do you have experience with Spring/Hibernate/DWR/HL7/Tomcat/MySQL/AOP? (Experience with any/all is not a requirement.)
I have a little experience with Spring/Hibernate/Tomcat and quite some good experience with MySQL
10. What is your preferred method of contact and how should we reach you with it? (phone, email, Skype, IRC, IM, etc.)
My best and preferred method of contact is via email, and then also phone call or an IRC chat, does it well, as Less often use Skype. These are my contacts details in precedence flow from top to bottom;
My email address is: firstname.lastname@example.org
My IRC nick name: k-joseph
My Mobile phone number is: +256791763663
Skype address: kaweesi.joseph
11. Please include your IRC nickname used when visiting our channel previously.
12. Provide ticket numbers of any patches/code you have committed to the OpenMRS code base.