dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #29343
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14801: local/in PBF work in progress
------------------------------------------------------------
revno: 14801
committer: Mithilesh Kumar Thakur <mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-04-11 13:06:13 +0100
message:
local/in PBF work in progress
modified:
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupService.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupStore.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultLookupService.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateLookupStore.java
local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/lookup/action/GetAllLookupsAction.java
local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties
local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm
local/in/pom.xml
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java 2014-03-14 11:22:16 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/aggregation/action/RunAggregationQueryAction.java 2014-04-11 12:06:13 +0000
@@ -144,6 +144,13 @@
orgUnitList.addAll( organisationUnitService.getOrganisationUnitWithChildren( org.getId() ) ) ;
}
+ /*
+ List<OrganisationUnit> rootOrganisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getRootOrganisationUnits() );
+
+ OrganisationUnit rootOrganisationUnit = rootOrganisationUnits.get( 0 );
+ */
+
+
//Set<OrganisationUnitGroup> orgUnitGroups = new HashSet<OrganisationUnitGroup>( organisationUnitGroupService.getAllOrganisationUnitGroups() );
/*List<OrganisationUnitGroup> ouGroups = new ArrayList<OrganisationUnitGroup>( organisationUnitGroupService.getOrganisationUnitGroupByName( EquipmentAttributeValue.HEALTHFACILITY ) );
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupService.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupService.java 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupService.java 2014-04-11 12:06:13 +0000
@@ -24,6 +24,8 @@
Collection<Lookup> getAllLookupsByType( String type );
Collection<Lookup> getAllLookups();
-
+
+ Collection<Lookup> getAllLookupsSortByType();
+
void searchLookupByName( List<Lookup> lookups, String key );
}
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupStore.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupStore.java 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/api/LookupStore.java 2014-04-11 12:06:13 +0000
@@ -25,4 +25,6 @@
Collection<Lookup> getAllLookupsByType( String type );
Collection<Lookup> getAllLookups();
+
+ Collection<Lookup> getAllLookupsSortByType();
}
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultLookupService.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultLookupService.java 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/DefaultLookupService.java 2014-04-11 12:06:13 +0000
@@ -67,6 +67,13 @@
return lookupStore.getAllLookups();
}
+
+@Override
+public Collection<Lookup> getAllLookupsSortByType()
+{
+ return lookupStore.getAllLookupsSortByType();
+}
+
// Search lookup by name
public void searchLookupByName( List<Lookup> lookups, String key )
{
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateLookupStore.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateLookupStore.java 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/impl/HibernateLookupStore.java 2014-04-11 12:06:13 +0000
@@ -5,6 +5,7 @@
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.common.hibernate.HibernateIdentifiableObjectStore;
import org.hisp.dhis.pbf.api.Lookup;
@@ -102,4 +103,16 @@
return criteria.list();
}
+
+ @SuppressWarnings( "unchecked" )
+ @Override
+ public Collection<Lookup> getAllLookupsSortByType()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( Lookup.class );
+ criteria.addOrder( Order.asc( "description" ) );
+ return criteria.list();
+ }
+
}
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/lookup/action/GetAllLookupsAction.java'
--- local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/lookup/action/GetAllLookupsAction.java 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/java/org/hisp/dhis/pbf/lookup/action/GetAllLookupsAction.java 2014-04-11 12:06:13 +0000
@@ -1,6 +1,7 @@
package org.hisp.dhis.pbf.lookup.action;
import static org.apache.commons.lang.StringUtils.isNotBlank;
+
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -8,9 +9,6 @@
import org.hisp.dhis.paging.ActionPagingSupport;
import org.hisp.dhis.pbf.api.Lookup;
import org.hisp.dhis.pbf.api.LookupService;
-import org.hisp.dhis.system.paging.Paging;
-
-import com.opensymphony.xwork2.Action;
public class GetAllLookupsAction
extends ActionPagingSupport<Lookup>
@@ -57,8 +55,16 @@
public String execute()
throws Exception
{
- lookups = new ArrayList<Lookup>( lookupService.getAllLookups() );
-
+ //lookups = new ArrayList<Lookup>( lookupService.getAllLookups() );
+ lookups = new ArrayList<Lookup>( lookupService.getAllLookupsSortByType() );
+
+ /*
+ for( Lookup lookup : lookups )
+ {
+ System.out.println( "Lookup : " + lookup .getDescription() );
+ }
+ */
+
if ( isNotBlank( key ) )
{
lookupService.searchLookupByName( lookups, key );
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties'
--- local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties 2014-04-10 10:30:33 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/resources/org/hisp/dhis/pbf/i18n_module.properties 2014-04-11 12:06:13 +0000
@@ -58,4 +58,12 @@
adjusted_amount = Adjusted Amount
adjusted_amount_including_quality = Adjusted Amount (Incl Quality)
total_amt_to_pay = Total Amount to Pay
-total_unadjusted_amount = Total Unadjusted Amount
\ No newline at end of file
+total_unadjusted_amount = Total Unadjusted Amount
+
+lookups = Lookups
+lookup_management = Lookup Management
+add_lookup = Add Lookup
+edit_lookup = Edit Lookup
+lookup_details = Lookup Details
+confirm_delete_lookup = Are you sure you want to delete lookup?
+value = Value
=== modified file 'local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm'
--- local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm 2014-03-03 06:33:06 +0000
+++ local/in/dhis-web-maintenance-pbf/src/main/webapp/dhis-web-maintenance-pbf/getAllLookups.vm 2014-04-11 12:06:13 +0000
@@ -2,7 +2,7 @@
<script type="text/javascript">
jQuery(document).ready(function(){
- tableSorter( 'listTable' );
+ tableSorter( 'lookupList' );
dhis2.contextmenu.makeContextMenu({
menuId: 'contextMenu',
@@ -25,7 +25,7 @@
</div>
-<table class="mainPageTable">
+<table class="mainPageTable" >
<tr>
<td style="vertical-align:top">
<table width="100%">
@@ -36,11 +36,12 @@
</td>
</tr>
</table>
- <table class="listTable">
+ <table class="listTable" id="lookupList" >
<col>
<thead>
<tr>
<th>$i18n.getString( "name" )</th>
+ <th>$i18n.getString( "type" )</th>
</tr>
</thead>
<tbody id="list">
@@ -54,6 +55,7 @@
data-can-update="$security.canUpdate( $lookup )"
data-can-delete="$security.canDelete( $lookup )">
<td>$encoder.htmlEncode( $!lookup.name )</td>
+ <td>$encoder.htmlEncode( $!lookup.getDescription() )</td>
</tr>
#end
</tbody>
=== modified file 'local/in/pom.xml'
--- local/in/pom.xml 2014-04-11 08:58:44 +0000
+++ local/in/pom.xml 2014-04-11 12:06:13 +0000
@@ -21,7 +21,6 @@
<module>dhis-web-coldchain</module>
<module>dhis-web-dataentry-ccem</module> -->
-
<!--<module>dhis-web-dashboard</module>
<module>dhis-web-dataentry-linelisting</module>
<module>dhis-web-excelimport</module>-->