=== modified file 'DHISMobile/.classpath' --- DHISMobile/.classpath 2010-10-20 15:56:07 +0000 +++ DHISMobile/.classpath 2010-10-20 17:40:52 +0000 @@ -2,9 +2,9 @@ - + + - === modified file 'DHISMobile/.mtj' --- DHISMobile/.mtj 2010-10-20 14:54:30 +0000 +++ DHISMobile/.mtj 2010-10-20 17:40:52 +0000 @@ -1,55 +1,45 @@ -<<<<<<< TREE -======= - - ->>>>>>> MERGE-SOURCE -<<<<<<< TREE + -======= - - - - ->>>>>>> MERGE-SOURCE - - - + - - - - - - + + + + + + + + + - + + - - - + - + - + + - - + + @@ -62,17 +52,9 @@ -<<<<<<< TREE - - -======= - ->>>>>>> MERGE-SOURCE -<<<<<<< TREE -======= ->>>>>>> MERGE-SOURCE + @@ -82,89 +64,5 @@ -<<<<<<< TREE - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -======= - - - - - - - - - - - - - - - ->>>>>>> MERGE-SOURCE - - - - - - - - - - - - - - - - - - \ No newline at end of file === modified file 'DHISMobile/build.properties' --- DHISMobile/build.properties 2010-10-20 15:56:07 +0000 +++ DHISMobile/build.properties 2010-10-20 17:40:52 +0000 @@ -1,21 +1,11 @@ # MTJ Build Properties -DefaultColorPhone.includes=src\ -,res\ - -DefaultColorPhone.excludes=\ - -S40_5th_Edition_SDK_Feature_Pack_1.includes=src\ -,res\ - -S40_5th_Edition_SDK_Feature_Pack_1.excludes=\ - -S40_5th_Edition_SDK_Feature_Pack_1.includes=src\ -,res\ - -S40_5th_Edition_SDK_Feature_Pack_1.excludes=\ - -DefaultColorPhone.includes=src\ -,res\ - -DefaultColorPhone.excludes=\ +S40_5th_Edition_SDK_Feature_Pack_1.includes=src\ +,res\ + +S40_5th_Edition_SDK_Feature_Pack_1.excludes=\ + +S40_5th_Edition_SDK_Feature_Pack_1_Lite.includes=src\ +,res\ + +S40_5th_Edition_SDK_Feature_Pack_1_Lite.excludes=\ === modified file 'DHISMobile/src/org/hisp/dhis/mobile/reporting/gui/DHISMIDlet.java' --- DHISMobile/src/org/hisp/dhis/mobile/reporting/gui/DHISMIDlet.java 2010-10-20 15:56:07 +0000 +++ DHISMobile/src/org/hisp/dhis/mobile/reporting/gui/DHISMIDlet.java 2010-10-20 17:40:52 +0000 @@ -54,7 +54,6 @@ import org.hisp.dhis.mobile.reporting.util.AlertUtil; import org.hisp.dhis.mobile.reporting.util.ReinitConfirmListener; - /** * @author abyotag_adm */ @@ -257,19 +256,18 @@ } else if (displayable == loginForm) { if (command == lgnFrmExtCmd) { exitMIDlet(); - } - else if (command == lgnFrmLgnCmd) { + } else if (command == lgnFrmLgnCmd) { if (getUserName().getString().trim().length() == 0 || getPassword().getString().trim().length() == 0) { switchDisplayable(AlertUtil.getErrorAlert( "Incomplete Form", "Username or Password Missing"), getLoginForm()); return; - } + } switchDisplayable(null, getWaitForm()); - + login(); - + // switchDisplayable(null, getMainMenuList()); } } else if (displayable == mainMenuList) { @@ -387,8 +385,6 @@ e.printStackTrace(); } } - - public boolean isDownloading() { return downloading; @@ -679,7 +675,7 @@ public TextField getUrl() { if (url == null) { url = new TextField("Server Location", - "http://localhost:8080/api/", 64, TextField.URL); + "http://localhost:8080/cbhis/api/", 64, TextField.URL); } return url; } @@ -1198,6 +1194,11 @@ choiceGroup = new ChoiceGroup("", Choice.MULTIPLE); choiceGroup.append(de.getName(), null); choiceGroup.setFitPolicy(Choice.TEXT_WRAP_ON); + if (dataValue.getVal().equals("false")) { + choiceGroup.setSelectedIndex(0, false); + } else { + choiceGroup.setSelectedIndex(0, true); + } form.append(choiceGroup); dataElements.put(de, choiceGroup); } else { @@ -1220,9 +1221,14 @@ } else if (de.getType().equals("int")) { TextField intField = new TextField(de.getName(), "", 32, TextField.NUMERIC); - ; form.append(intField); dataElements.put(de, intField); + } else if (de.getType().equals("bool")) { + choiceGroup = new ChoiceGroup("", Choice.MULTIPLE); + choiceGroup.append(de.getName(), null); + choiceGroup.setFitPolicy(Choice.TEXT_WRAP_ON); + form.append(choiceGroup); + dataElements.put(de, choiceGroup); } else { TextField txtField = new TextField(de.getName(), "", 32, TextField.ANY); @@ -1307,7 +1313,7 @@ maintenanceList.append("Delete Program", null); maintenanceList.append("Download Activity Plan", null); maintenanceList.append("Delete Activity Plan", null); - maintenanceList.append("Download All",null); + maintenanceList.append("Download All", null); maintenanceList.addCommand(getMntnceBakCmd()); maintenanceList.setCommandListener(this); // maintenanceList.setSelectedFlags(new boolean[] { false, false }); @@ -1355,7 +1361,7 @@ switchDisplayable(null, getWaitForm()); deleteActivityPlan(); - }else if(__selectedString.equals("Download All")){ + } else if (__selectedString.equals("Download All")) { getWaitForm().deleteAll(); getWaitForm().setTitle("Download All"); getWaitForm().append("Please wait........"); @@ -1365,8 +1371,6 @@ } } } - - /** * Returns an initialized instance of mntnceBakCmd component. @@ -1668,11 +1672,12 @@ for (int i = 0; i < activities.size(); i++) { Activity activity = (Activity) activities.elementAt(i); - + getActivityPlanList().insert( i, activity.getBeneficiary().getFullName() + "\n" - + Period.formatDailyPeriod(activity.getDueDate()), null); + + Period.formatDailyPeriod(activity.getDueDate()), + null); } @@ -1755,8 +1760,8 @@ ConnectionManager.BROWSE_DATASETS); connectionManager.start(); } - - public void downloadAll(){ + + public void downloadAll() { loadSettings(); ConnectionManager connectionManager = new ConnectionManager(this, getUrl().getString(), getDhisUserName().getString(), @@ -1930,9 +1935,9 @@ getErrorAlert().setString("FAILURE"); switchDisplayable(getErrorAlert(), getDsDnldList()); } -// getSuccessAlert().setTitle("Download Status"); -// getSuccessAlert().setString("SUCCESS"); -// switchDisplayable(getSuccessAlert(), getPrDnldList()); + // getSuccessAlert().setTitle("Download Status"); + // getSuccessAlert().setString("SUCCESS"); + // switchDisplayable(getSuccessAlert(), getPrDnldList()); switchDisplayable(getSuccessAlert(), getMainMenuList()); } catch (RecordStoreException rse) { @@ -1959,7 +1964,7 @@ } else { getErrorAlert().setTitle("Download Status"); getErrorAlert().setString("FAILURE"); -// switchDisplayable(getErrorAlert(), getMaintenanceList()); + // switchDisplayable(getErrorAlert(), getMaintenanceList()); switchDisplayable(getErrorAlert(), getMainMenuList()); } } @@ -2122,10 +2127,15 @@ } DataValue dv = new DataValue(); - dv.setId(de.getId()); - dv.setVal(val); - - activityValue.getDataValues().addElement(dv); + if (val != null && val.equals("")) { + switchDisplayable(AlertUtil.getInfoAlert("Warning", + "Some fields are empty... Please check"), + getActivityEntryForm()); + } else { + dv.setId(de.getId()); + dv.setVal(val); + activityValue.getDataValues().addElement(dv); + } } return activityValue; === modified file 'DHISMobile/src/org/hisp/dhis/mobile/test/Base64Test.java' --- DHISMobile/src/org/hisp/dhis/mobile/test/Base64Test.java 2010-10-20 07:38:45 +0000 +++ DHISMobile/src/org/hisp/dhis/mobile/test/Base64Test.java 2010-10-20 17:40:52 +0000 @@ -1,4 +1,5 @@ package org.hisp.dhis.mobile.test; + import org.hisp.dhis.mobile.reporting.connection.Base64; import jmunit.framework.cldc11.AssertionFailedException; @@ -11,15 +12,12 @@ public class Base64Test extends TestCase { public Base64Test() { - super(2, "Base64Test"); + super(1, "Base64Test"); } public void test(int testNumber) { switch (testNumber) { case 0: - testDecode(); - break; - case 1: testEncode(); break; default: @@ -27,25 +25,11 @@ } } - public void testDecode() throws AssertionFailedException { - try { - System.out.println("decode"); - String strs_1 = ""; - byte[] expResult_1 = null; - byte[] result_1 = Base64.decode(strs_1); - assertEquals(expResult_1, result_1); - fail("Could not decode correctly"); - } catch (Exception e) { - e.printStackTrace(); - } - } - public void testEncode() throws AssertionFailedException { System.out.println("encode"); - byte[] bytes_1 = null; - String expResult_1 = ""; + byte[] bytes_1 = "admin:District@123".getBytes(); + String expResult_1 = "YWRtaW46RGlzdHJpY3RAMTIz"; String result_1 = Base64.encode(bytes_1, 0, bytes_1.length); assertEquals(expResult_1, result_1); - fail("Could not encode correctly"); } }