Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
08/11/08 16:11:10 (5 months ago)
Author:
machosry
Message:

address hierarchy: completed few enhancements suggested in the dev call. still the portlet overriding is not solved yet.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs-modules/addresshierarchy

    • Property svn:ignore set to
      dist
      build
  • openmrs-modules/addresshierarchy/web/src/org/openmrs/module/addresshierarchy/web/dwr/DWRAddressHierarchyService.java

    r4834 r5238  
    66import org.openmrs.module.addresshierarchy.AddressHierarchy; 
    77import org.openmrs.module.addresshierarchy.AddressHierarchyService; 
     8import org.openmrs.module.addresshierarchy.AddressHierarchyType; 
    89 
    910public class DWRAddressHierarchyService { 
     
    100101         
    101102    } 
     103     
     104    public String[] getLocationType(){ 
     105        return getService().getLocationType(); 
     106    } 
     107     
     108    public String[] getLocationTypeTable(){ 
     109        return getService().getLocationTypeTable(); 
     110    } 
     111     
     112    public void updateLocationTypeTable(String[] comp){ 
     113        String[] arr = {"Country","State/Province","City/Village","Neighborhood/Cell","County/District","Township/Division","Sub Region","Region","Postal Code","Longitude","Latitude"}; 
     114                AddressHierarchyType aht = new AddressHierarchyType(); 
     115        int j=0; 
     116        for(int i=0;i<arr.length;i++){ 
     117                aht.setTypeId(i+1); 
     118                aht.setName(arr[i]); 
     119                aht.setListorder(Integer.parseInt(comp[j])); 
     120                j++; 
     121                aht.setChoice(Integer.parseInt(comp[j])); 
     122                j++; 
     123                System.out.println(aht.toString()); 
     124                try{ 
     125                        getService().updateLocationTypeTable(aht); 
     126                } 
     127                catch(Exception e){ 
     128                        e.printStackTrace(); 
     129                } 
     130        } 
     131         
     132    } 
     133     
     134    public String[] getAddressHierarchyTypeList(Integer typeid){ 
     135        String[] arr = getService().getAddressHierarchyTypeList(typeid); 
     136        return arr; 
     137    } 
    102138 
    103139}