Download Source Code for Development
From MoCa Development Wiki
For developers: follow these instructions if you are interested in doing development and adding features to Moca. Before you begin, it is recommended that you visit the Installing Tools page. Browse the version 1.0 release of the Moca code is available on Google Code as of February 2010 and released under the BSD License: http://code.google.com/p/moca/
Contents |
Moca Android Application
Get Code
- Import the “moca” client project code (Android application) into Eclipse from the server
- In Eclipse, right click in the left hand side panel (Package Explorer) > Import
- Click on SVN folder > Checkout project from SVN
- Create new repository location
- If you're downloading the code for deployment, use our stable release 1.0.
Location: https://moca.googlecode.com/svn/clients/android/branches/release-1.0.x/ - If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
Location: https://moca.googlecode.com/svn/clients/android/trunk
- If you're downloading the code for deployment, use our stable release 1.0.
- Click OK. Select entire contents of the folder. Finish.
- If you get compile errors related to the library paths not found or the android-4 device not found, it’s because you haven’t setup the Android Virtual devices (See http://www.mocamobile.org/development/index.php?title=Installing_Tools#Android_Tools section)
Important Code Files
- Entry point of application
moca/src/org/moca/activity/Moca.java - Controls main activity, launches a certain procedure, controls flow from page to page
moca/src/org/moca/activity/ - MDS Interface with Moca Android app
moca/src/org/moca/net/ - Elements on a Page (picture, free text, radio button)
moca/src/org/moca/procedure/ - Code file that must be edited when new procedures are added
moca/src/org/moca/util/MocaUtil.java - Folder where XML files of new procedures are added
moca/trunk/clients/moca/res/raw/
Run Android Application
- Run Moca in Android emulator on computer
- Right click the “MoCa” project > Run As > Android Application and it should automatically start up an Android 1.6 emulator
- ..OR.. Run Moca on Android Phone, attach phone to computer via USB cable
- In Eclipse, Right click the folder > Run > Android Application
Setup Phone
- On Phone, Hit Menu > Reload Database
- Menu > Settings
- Moca Dispatch Server URL: http://demo.sanamobile.org/mds
- Username: admin
- Password: Sanamobile1
- (or you can use the username: remotedoctor, password: Sanamobile1)
Uninstall Application
- Uninstall Moca application on Android Phone
- On phone, go to Home > Settings > Applications > Manage Applications > Moca
- Uninstall > OK
Create New Procedure
- Create new procedure for the phone (Read section on How to Define Your Own Procedures)
- Under the code branch, MoCa > res > raw
- Right click raw > New > File
- Create new xml file (ex: radiology.xml)
- To rename, Right click the file > Refactor > Rename
- Copy surgery.xml and create procedure and pages according to the doctor’s wishes
- Add this procedure to the list of procedures by going to MoCa > src > org.moca.util > MocaUtil.java
OpenMRS Module: Moca
Get Code
- Import the “moca-server” project code (OpenMRS Moca module) into Eclipse
- In Eclipse, right click in the left hand side panel (Package Explorer) > Import
- Click on SVN folder > Checkout project from SVN
- Create new repository location
- If you're downloading the code for deployment, use our stable release 1.0.
Location: https://moca.googlecode.com/svn/servers/openmrs-modules/moca/tags/release-1.0 - If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
Location: https://moca.googlecode.com/svn/servers/openmrs-modules/moca/trunk
- If you're downloading the code for deployment, use our stable release 1.0.
- Click OK. Select the entire contents of the folder. Finish.
Important Code Files
- Code for MDS Interface with OpenMRS Moca module
moca-server/web/src/org/moca/queue/web/ - Controller objects for JSP pages
moca-server/web/src/org/moca/queue/web/controller/ - JSP Pages
moca-server/web/module/ - Servlets
moca-server/web/src/org/moca/queue/web/servlet/
Compile .omod File
- To create the .omod file for this OpenMRS modules, open a command prompt.
- Change directory until you get to the moca-server folder that contains the build.xml file
- Execute
ant clean package-module - The .omod file will now appear in the moca-server/dist folder
Install Module into OpenMRS
- Use this .omod file to upload an updated copy of the module to OpenMRS (see OpenMRS installation instructions on how to install a new module).
OpenMRS Module: Flash Media Viewer
Get Code
- Import the “flashmediaviewer” project code (OpenMRS Moca Media Viewer module) into Eclipse
- In Eclipse, right click in the left hand side panel (Package Explorer) > Import
- Click on SVN folder > Checkout project from SVN
- Create new repository location
- If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
Location: https://moca.googlecode.com/svn/servers/openmrs-modules/viewer/trunk
- If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
- Click OK. Select the entire contents of the folder. Finish.
Compile .omod File
- To create the .omod file for these OpenMRS modules, open a command prompt.
- Change directory until you get to the flashmediaviewer folder that contains the build.xml file
- Execute
ant clean package-module - The .omod file will now appear in the flashmediaviewer/dist folder
Install Module into OpenMRS
- Use this .omod file to upload an updated copy of the module to OpenMRS (see OpenMRS installation instructions on how to install a new module).
OpenMRS Module: REST
Get Code
- Import the “rest” project code (OpenMRS REST module) into Eclipse
- In Eclipse, right click in the left hand side panel (Package Explorer) > Import
- Click on SVN folder > Checkout project from SVN
- Create new repository location
- If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
Location: https://moca.googlecode.com/svn/servers/openmrs-modules/rest/trunk
- If you're downloading the code for development, you'll want to take the code from the trunk and make sure you branch the code before making changes (svn copy from the command line or in Eclipse, Right-click on project > Team > Branch/Tag) Once the feature/changes are done, you can merge it back into the trunk.
- Click OK. Select the entire contents of the folder. Finish.
Compile .omod File
- To create the .omod file for these OpenMRS modules, open a command prompt.
- Change directory until you get to the rest folder that contains the build.xml file
- Execute
ant clean package-module - The .omod file will now appear in the rest/dist folder
Install Module into OpenMRS
- Use this .omod file to upload an updated copy of the module to OpenMRS (see OpenMRS installation instructions on how to install a new module).
Flex Code for Flash Media Viewer
- (Optional) To get the Flash/Flex code for the media viewer in OpenMRS, install and open FlexBuilder (see [1])
- Check out code from repository location
Location: https://moca.googlecode.com/svn/servers/openmrs-modules/flashviewer/trunk
MDS: Moca Dispatch Server
If you want to have a test server up or need an MDS instance for a deployment, see these directions on how to obtain the code and set it up. http://www.mocamobile.org/development/index.php?title=Setup_Servers#Install_Moca_Dispatch_Server_.28MDS.29
