dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17448
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6946: CCEM work in progress
------------------------------------------------------------
revno: 6946
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2012-05-15 16:03:46 +0530
message:
CCEM work in progress
removed:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentDetailsService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentDetailsStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/EquipmentDetails.hbm.xml
added:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentService.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/Equipment.hbm.xml
renamed:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetails.java => local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/Equipment.java
modified:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentInstanceService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogDataValueStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeOptionStore.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentInstanceService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddColdChainCatalogTypeAttributeForm.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/AddEquipmentAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/EquipmentSelectAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceDataAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceListAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/UpdateEquipmentAction.java
local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/Equipment.java
--
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
=== renamed file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetails.java' => 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/Equipment.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetails.java 2012-04-16 11:29:53 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/Equipment.java 2012-05-15 10:33:46 +0000
@@ -1,10 +1,14 @@
package org.hisp.dhis.coldchain.inventory;
-import java.io.Serializable;
+import org.hisp.dhis.common.BaseIdentifiableObject;
-public class EquipmentDetails implements Serializable
+public class Equipment extends BaseIdentifiableObject
{
-
+ /**
+ * Determines if a de-serialized file is compatible with this class.
+ */
+ private static final long serialVersionUID = -6551567526188061690L;
+
private EquipmentInstance equipmentInstance;
private InventoryTypeAttribute inventoryTypeAttribute;
@@ -17,11 +21,11 @@
// Constructor
// -------------------------------------------------------------------------
- public EquipmentDetails()
+ public Equipment()
{
}
- public EquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute, String value )
+ public Equipment( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute, String value )
{
this.equipmentInstance = equipmentInstance;
this.inventoryTypeAttribute = inventoryTypeAttribute;
@@ -44,12 +48,12 @@
return false;
}
- if ( !(o instanceof EquipmentDetails) )
+ if ( !(o instanceof Equipment) )
{
return false;
}
- final EquipmentDetails other = (EquipmentDetails) o;
+ final Equipment other = (Equipment) o;
return equipmentInstance.equals( other.getEquipmentInstance() ) && inventoryTypeAttribute.equals( other.getInventoryTypeAttribute() );
=== removed file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsService.java 2012-04-30 08:30:00 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsService.java 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
-package org.hisp.dhis.coldchain.inventory;
-
-import java.util.Collection;
-
-public interface EquipmentDetailsService
-{
- String ID = EquipmentDetailsService.class.getName();
-
- void addEquipmentDetails( EquipmentDetails equipmentDetails );
-
- void updateEquipmentDetails( EquipmentDetails equipmentDetails );
-
- void deleteEquipmentDetails( EquipmentDetails equipmentDetails );
-
- Collection<EquipmentDetails> getAllEquipmentDetails();
-
- Collection<EquipmentDetails> getEquipmentDetails( EquipmentInstance equipmentInstance);
-
- EquipmentDetails getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute );
-}
=== removed file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsStore.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsStore.java 2012-04-30 08:30:00 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentDetailsStore.java 1970-01-01 00:00:00 +0000
@@ -1,21 +0,0 @@
-package org.hisp.dhis.coldchain.inventory;
-
-import java.util.Collection;
-
-public interface EquipmentDetailsStore
-{
- String ID = EquipmentDetailsStore.class.getName();
-
- void addEquipmentDetails( EquipmentDetails equipmentDetails );
-
- void updateEquipmentDetails( EquipmentDetails equipmentDetails );
-
- void deleteEquipmentDetails( EquipmentDetails equipmentDetails );
-
- Collection<EquipmentDetails> getAllEquipmentDetails();
-
- Collection<EquipmentDetails> getEquipmentDetails( EquipmentInstance equipmentInstance);
-
- EquipmentDetails getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute );
-
-}
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentInstanceService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentInstanceService.java 2012-05-04 07:42:28 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentInstanceService.java 2012-05-15 10:33:46 +0000
@@ -17,7 +17,7 @@
void deleteCompleteEquipmentInstance( EquipmentInstance equipmentInstance );
- int createEquipment( EquipmentInstance equipmentInstance, List<EquipmentDetails> equipmentDetails );
+ int createEquipment( EquipmentInstance equipmentInstance, List<Equipment> equipmentDetails );
EquipmentInstance getEquipmentInstance( int id );
=== added file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentService.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentService.java 2012-05-15 10:33:46 +0000
@@ -0,0 +1,22 @@
+package org.hisp.dhis.coldchain.inventory;
+
+import java.util.Collection;
+
+public interface EquipmentService
+{
+ String ID = EquipmentService.class.getName();
+
+ //void addEquipmentDetails( Equipment equipment );
+
+ void addEquipment( Equipment equipment );
+
+ void updateEquipment( Equipment equipment );
+
+ void deleteEquipment( Equipment equipment );
+
+ Collection<Equipment> getAllEquipments();
+
+ Collection<Equipment> getEquipments( EquipmentInstance equipmentInstance);
+
+ Equipment getEquipment( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute );
+}
=== added file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentStore.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/EquipmentStore.java 2012-05-15 10:33:46 +0000
@@ -0,0 +1,26 @@
+package org.hisp.dhis.coldchain.inventory;
+
+import java.util.Collection;
+
+import org.hisp.dhis.common.GenericNameableObjectStore;
+
+public interface EquipmentStore extends GenericNameableObjectStore<Equipment>
+{
+ String ID = EquipmentStore.class.getName();
+
+ /*
+ void addEquipmentDetails( Equipment equipmentDetails );
+
+ int addEquipmentDetails( Equipment equipment );
+
+ void updateEquipmentDetails( Equipment equipmentDetails );
+
+ void deleteEquipmentDetails( Equipment equipmentDetails );
+ */
+ Collection<Equipment> getAllEquipments();
+
+ Collection<Equipment> getEquipments( EquipmentInstance equipmentInstance);
+
+ Equipment getEquipment( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute );
+
+}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogDataValueStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogDataValueStore.java 2012-04-30 11:56:21 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogDataValueStore.java 2012-05-15 10:33:46 +0000
@@ -9,11 +9,8 @@
import org.hisp.dhis.coldchain.catalog.Catalog;
import org.hisp.dhis.coldchain.catalog.CatalogDataValue;
import org.hisp.dhis.coldchain.catalog.CatalogDataValueStore;
-import org.hisp.dhis.coldchain.catalog.CatalogType;
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeOption;
-import org.hisp.dhis.period.PeriodType;
-import org.hisp.dhis.reports.Report_in;
public class HibernateCatalogDataValueStore implements CatalogDataValueStore
{
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeOptionStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeOptionStore.java 2012-04-21 10:23:39 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/hibernate/HibernateCatalogTypeAttributeOptionStore.java 2012-05-15 10:33:46 +0000
@@ -10,8 +10,6 @@
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeOption;
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttributeOptionStore;
-import org.hisp.dhis.hibernate.HibernateGenericStore;
-import org.hisp.dhis.reports.Report_in;
public class HibernateCatalogTypeAttributeOptionStore implements CatalogTypeAttributeOptionStore
{
=== removed file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentDetailsService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentDetailsService.java 2012-05-02 06:03:10 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentDetailsService.java 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
-package org.hisp.dhis.coldchain.inventory;
-
-import java.util.Collection;
-
-import org.springframework.transaction.annotation.Transactional;
-@Transactional
-public class DefaultEquipmentDetailsService implements EquipmentDetailsService
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private EquipmentDetailsStore equipmentDetailsStore;
-
- public void setEquipmentDetailsStore( EquipmentDetailsStore equipmentDetailsStore )
- {
- this.equipmentDetailsStore = equipmentDetailsStore;
- }
-
- // -------------------------------------------------------------------------
- // EquipmentDetails
- // -------------------------------------------------------------------------
-
-
- @Override
- public void addEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- equipmentDetailsStore.addEquipmentDetails( equipmentDetails );
- }
- @Override
- public void deleteEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- equipmentDetailsStore.deleteEquipmentDetails( equipmentDetails );
- }
- @Override
- public Collection<EquipmentDetails> getAllEquipmentDetails()
- {
- return equipmentDetailsStore.getAllEquipmentDetails();
- }
- @Override
- public void updateEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- equipmentDetailsStore.updateEquipmentDetails( equipmentDetails );
- }
-
- public Collection<EquipmentDetails> getEquipmentDetails( EquipmentInstance equipmentInstance)
- {
- return equipmentDetailsStore.getEquipmentDetails( equipmentInstance );
- }
-
- public EquipmentDetails getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
- {
- return equipmentDetailsStore.getEquipmentDetails( equipmentInstance, inventoryTypeAttribute );
- }
-
-}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentInstanceService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentInstanceService.java 2012-05-04 07:42:28 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentInstanceService.java 2012-05-15 10:33:46 +0000
@@ -22,13 +22,13 @@
this.equipmentInstanceStore = equipmentInstanceStore;
}
- private EquipmentDetailsService equipmentDetailsService;
+ private EquipmentService equipmentService;
- public void setEquipmentDetailsService( EquipmentDetailsService equipmentDetailsService )
+ public void setEquipmentService( EquipmentService equipmentService )
{
- this.equipmentDetailsService = equipmentDetailsService;
+ this.equipmentService = equipmentService;
}
-
+
private EquipmentStatusService equipmentStatusService;
public void setEquipmentStatusService( EquipmentStatusService equipmentStatusService )
@@ -55,10 +55,10 @@
public void deleteCompleteEquipmentInstance( EquipmentInstance equipmentInstance )
{
- List<EquipmentDetails> equipmentDetailsList = new ArrayList<EquipmentDetails>( equipmentDetailsService.getEquipmentDetails( equipmentInstance ) );
- for( EquipmentDetails equipmentDetails : equipmentDetailsList )
+ List<Equipment> equipmentDetailsList = new ArrayList<Equipment>( equipmentService.getEquipments( equipmentInstance ) );
+ for( Equipment equipmentDetails : equipmentDetailsList )
{
- equipmentDetailsService.deleteEquipmentDetails( equipmentDetails );
+ equipmentService.deleteEquipment( equipmentDetails );
}
List<EquipmentStatus> equipmentStatusHistory = new ArrayList<EquipmentStatus>( equipmentStatusService.getEquipmentStatusHistory( equipmentInstance ) );
@@ -83,13 +83,13 @@
equipmentInstanceStore.update( equipmentInstance );
}
- public int createEquipment( EquipmentInstance equipmentInstance, List<EquipmentDetails> equipmentDetails )
+ public int createEquipment( EquipmentInstance equipmentInstance, List<Equipment> equipmentDetails )
{
int equipmentInstanceId = addEquipmentInstance( equipmentInstance );
- for( EquipmentDetails equipment : equipmentDetails )
+ for( Equipment equipment : equipmentDetails )
{
- equipmentDetailsService.addEquipmentDetails( equipment );
+ equipmentService.addEquipment( equipment );
}
return equipmentInstanceId;
=== added file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentService.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultEquipmentService.java 2012-05-15 10:33:46 +0000
@@ -0,0 +1,90 @@
+package org.hisp.dhis.coldchain.inventory;
+
+import java.util.Collection;
+
+import org.springframework.transaction.annotation.Transactional;
+@Transactional
+public class DefaultEquipmentService implements EquipmentService
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private EquipmentStore equipmentStore;
+
+ public void setEquipmentStore( EquipmentStore equipmentStore )
+ {
+ this.equipmentStore = equipmentStore;
+ }
+
+
+
+ // -------------------------------------------------------------------------
+ // EquipmentDetails
+ // -------------------------------------------------------------------------
+
+ /*
+ @Override
+ public void addEquipmentDetails( Equipment equipmentDetails )
+ {
+ equipmentStore.addEquipmentDetails( equipmentDetails );
+ }
+ @Override
+ public void deleteEquipmentDetails( Equipment equipmentDetails )
+ {
+ equipmentStore.deleteEquipmentDetails( equipmentDetails );
+ }
+ @Override
+ public Collection<Equipment> getAllEquipmentDetails()
+ {
+ return equipmentStore.getAllEquipmentDetails();
+ }
+ @Override
+ public void updateEquipmentDetails( Equipment equipmentDetails )
+ {
+ equipmentStore.updateEquipmentDetails( equipmentDetails );
+ }
+
+ public Collection<Equipment> getEquipmentDetails( EquipmentInstance equipmentInstance)
+ {
+ return equipmentStore.getEquipmentDetails( equipmentInstance );
+ }
+
+ public Equipment getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
+ {
+ return equipmentStore.getEquipmentDetails( equipmentInstance, inventoryTypeAttribute );
+ }
+ */
+ @Override
+ public void addEquipment( Equipment equipment )
+ {
+ equipmentStore.save( equipment );
+ }
+ @Override
+ public void deleteEquipment( Equipment equipment )
+ {
+ equipmentStore.delete( equipment );
+ }
+
+ @Override
+ public void updateEquipment( Equipment equipment )
+ {
+ equipmentStore.update( equipment );
+ }
+
+ @Override
+ public Collection<Equipment> getAllEquipments()
+ {
+ return equipmentStore.getAllEquipments();
+ }
+
+ public Collection<Equipment> getEquipments( EquipmentInstance equipmentInstance)
+ {
+ return equipmentStore.getEquipments( equipmentInstance );
+ }
+
+ public Equipment getEquipment( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
+ {
+ return equipmentStore.getEquipment( equipmentInstance, inventoryTypeAttribute );
+ }
+}
=== removed file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentDetailsStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentDetailsStore.java 2012-04-30 08:30:00 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentDetailsStore.java 1970-01-01 00:00:00 +0000
@@ -1,90 +0,0 @@
-package org.hisp.dhis.coldchain.inventory.hibernate;
-
-import java.util.Collection;
-
-import org.hibernate.Criteria;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetails;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetailsStore;
-import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
-import org.hisp.dhis.coldchain.inventory.InventoryType;
-import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
-import org.hisp.dhis.organisationunit.OrganisationUnit;
-
-public class HibernateEquipmentDetailsStore implements EquipmentDetailsStore
-{
- // -------------------------------------------------------------------------
- // Dependencies
- // -------------------------------------------------------------------------
-
- private SessionFactory sessionFactory;
-
- public void setSessionFactory( SessionFactory sessionFactory )
- {
- this.sessionFactory = sessionFactory;
- }
-
- // -------------------------------------------------------------------------
- // EquipmentDetails
- // -------------------------------------------------------------------------
-
- @Override
- public void addEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- Session session = sessionFactory.getCurrentSession();
-
- session.save( equipmentDetails );
- }
-
- @Override
- public void deleteEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- Session session = sessionFactory.getCurrentSession();
-
- session.delete( equipmentDetails );
- }
-
- @Override
- public Collection<EquipmentDetails> getAllEquipmentDetails()
- {
- Session session = sessionFactory.getCurrentSession();
-
- return session.createCriteria( EquipmentDetails.class ).list();
- }
-
- @Override
- public void updateEquipmentDetails( EquipmentDetails equipmentDetails )
- {
- Session session = sessionFactory.getCurrentSession();
-
- session.update( equipmentDetails );
- }
-
- public Collection<EquipmentDetails> getEquipmentDetails( EquipmentInstance equipmentInstance )
- {
- Session session = sessionFactory.getCurrentSession();
-
- Criteria criteria = session.createCriteria( EquipmentDetails.class );
-
- criteria.add( Restrictions.eq( "equipmentInstance", equipmentInstance ) );
-
- return criteria.list();
- }
-
- public EquipmentDetails getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
- {
- Session session = sessionFactory.getCurrentSession();
-
- Criteria criteria = session.createCriteria( EquipmentDetails.class );
-
- criteria.add( Restrictions.eq( "equipmentInstance", equipmentInstance ) );
- criteria.add( Restrictions.eq( "inventoryTypeAttribute", inventoryTypeAttribute ) );
-
- return (EquipmentDetails) criteria.uniqueResult();
- }
-
-
-}
=== added file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentStore.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentStore.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/hibernate/HibernateEquipmentStore.java 2012-05-15 10:33:46 +0000
@@ -0,0 +1,114 @@
+package org.hisp.dhis.coldchain.inventory.hibernate;
+
+import java.util.Collection;
+
+import org.hibernate.criterion.Restrictions;
+import org.hisp.dhis.coldchain.inventory.Equipment;
+import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
+import org.hisp.dhis.coldchain.inventory.EquipmentStore;
+import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
+import org.hisp.dhis.hibernate.HibernateGenericStore;
+
+public class HibernateEquipmentStore extends HibernateGenericStore<Equipment> implements EquipmentStore
+{
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+ /*
+ private SessionFactory sessionFactory;
+
+ public void setSessionFactory( SessionFactory sessionFactory )
+ {
+ this.sessionFactory = sessionFactory;
+ }
+ */
+ // -------------------------------------------------------------------------
+ // EquipmentDetails
+ // -------------------------------------------------------------------------
+ /*
+ @Override
+ public void addEquipmentDetails( Equipment equipmentDetails )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.save( equipmentDetails );
+ }
+
+ @Override
+ public void deleteEquipmentDetails( Equipment equipmentDetails )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.delete( equipmentDetails );
+ }
+
+ @Override
+ public Collection<Equipment> getAllEquipmentDetails()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ return session.createCriteria( Equipment.class ).list();
+ }
+
+ @Override
+ public void updateEquipmentDetails( Equipment equipmentDetails )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ session.update( equipmentDetails );
+ }
+
+
+ @Override
+ public Collection<Equipment> getAllEquipmentDetails()
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ return session.createCriteria( Equipment.class ).list();
+ }
+
+
+ public Collection<Equipment> getEquipmentDetails( EquipmentInstance equipmentInstance )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( Equipment.class );
+
+ criteria.add( Restrictions.eq( "equipmentInstance", equipmentInstance ) );
+
+ return criteria.list();
+ }
+
+ public Equipment getEquipmentDetails( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
+ {
+ Session session = sessionFactory.getCurrentSession();
+
+ Criteria criteria = session.createCriteria( Equipment.class );
+
+ criteria.add( Restrictions.eq( "equipmentInstance", equipmentInstance ) );
+ criteria.add( Restrictions.eq( "inventoryTypeAttribute", inventoryTypeAttribute ) );
+
+ return (Equipment) criteria.uniqueResult();
+ }
+ */
+
+ @Override
+ @SuppressWarnings( "unchecked" )
+ public Collection<Equipment> getAllEquipments()
+ {
+ return sessionFactory.getCurrentSession().createCriteria( Equipment.class ).list();
+ }
+
+ @Override
+ @SuppressWarnings( "unchecked" )
+ public Collection<Equipment> getEquipments( EquipmentInstance equipmentInstance )
+ {
+ return getCriteria( Restrictions.eq( "equipmentInstance", equipmentInstance ) ).list();
+ }
+
+ public Equipment getEquipment( EquipmentInstance equipmentInstance, InventoryTypeAttribute inventoryTypeAttribute )
+ {
+ return (Equipment) getCriteria( Restrictions.eq( "equipmentInstance", equipmentInstance ),Restrictions.eq( "inventoryTypeAttribute", inventoryTypeAttribute ) ).uniqueResult();
+ }
+}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-05-10 05:39:14 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-05-15 10:33:46 +0000
@@ -44,11 +44,20 @@
class="org.hisp.dhis.coldchain.catalog.hibernate.HibernateCatalogDataValueStore">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
-
+<!--
<bean id="org.hisp.dhis.coldchain.inventory.EquipmentDetailsStore"
class="org.hisp.dhis.coldchain.inventory.hibernate.HibernateEquipmentDetailsStore">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
+-->
+
+ <bean id="org.hisp.dhis.coldchain.inventory.EquipmentStore"
+ class="org.hisp.dhis.coldchain.inventory.hibernate.HibernateEquipmentStore">
+ <property name="clazz" value="org.hisp.dhis.coldchain.inventory.Equipment" />
+ <property name="sessionFactory" ref="sessionFactory"/>
+ <property name="cacheable" value="true" />
+ </bean>
+
<bean id="org.hisp.dhis.coldchain.inventory.EquipmentInstanceStore"
class="org.hisp.dhis.coldchain.inventory.hibernate.HibernateEquipmentInstanceStore">
<property name="clazz" value="org.hisp.dhis.coldchain.inventory.EquipmentInstance" />
@@ -128,15 +137,21 @@
class="org.hisp.dhis.coldchain.catalog.DefaultCatalogDataValueService">
<property name="catalogDataValueStore" ref="org.hisp.dhis.coldchain.catalog.CatalogDataValueStore"/>
</bean>
-
+<!--
<bean id="org.hisp.dhis.coldchain.inventory.EquipmentDetailsService"
class="org.hisp.dhis.coldchain.inventory.DefaultEquipmentDetailsService">
<property name="equipmentDetailsStore" ref="org.hisp.dhis.coldchain.inventory.EquipmentDetailsStore"/>
</bean>
+-->
+ <bean id="org.hisp.dhis.coldchain.inventory.EquipmentService"
+ class="org.hisp.dhis.coldchain.inventory.DefaultEquipmentService">
+ <property name="equipmentStore" ref="org.hisp.dhis.coldchain.inventory.EquipmentStore"/>
+ </bean>
+
<bean id="org.hisp.dhis.coldchain.inventory.EquipmentInstanceService"
class="org.hisp.dhis.coldchain.inventory.DefaultEquipmentInstanceService">
<property name="equipmentInstanceStore" ref="org.hisp.dhis.coldchain.inventory.EquipmentInstanceStore"/>
- <property name="equipmentDetailsService" ref="org.hisp.dhis.coldchain.inventory.EquipmentDetailsService"/>
+ <property name="equipmentService" ref="org.hisp.dhis.coldchain.inventory.EquipmentService"/>
<property name="equipmentStatusService" ref="org.hisp.dhis.coldchain.inventory.EquipmentStatusService"/>
</bean>
<bean id="org.hisp.dhis.coldchain.inventory.EquipmentStatusService"
=== added file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/Equipment.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/Equipment.hbm.xml 1970-01-01 00:00:00 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/Equipment.hbm.xml 2012-05-15 10:33:46 +0000
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class name="org.hisp.dhis.coldchain.inventory.Equipment" table="equipment">
+
+ <composite-id>
+ <key-many-to-one name="equipmentInstance" class="org.hisp.dhis.coldchain.inventory.EquipmentInstance" column="equipmentinstanceid"
+ foreign-key="fk_equipment_equipmentmentinstanceid" />
+ <key-many-to-one name="inventoryTypeAttribute" class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute" column="inventorytypeattributeid"
+ foreign-key="fk_equipment_inventorytypeattributeid" />
+ </composite-id>
+
+ <property name="value" />
+
+ <many-to-one name="inventoryTypeAttributeOption" class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOption" column="inventorytypeattributeoptionid"
+ foreign-key="fk_equipment_inventorytypeattributeoptionid" />
+
+ </class>
+</hibernate-mapping>
=== removed file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/EquipmentDetails.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/EquipmentDetails.hbm.xml 2012-04-17 11:59:19 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/EquipmentDetails.hbm.xml 1970-01-01 00:00:00 +0000
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
-
-<hibernate-mapping>
- <class name="org.hisp.dhis.coldchain.inventory.EquipmentDetails" table="equipmentdetails">
-
- <composite-id>
- <key-many-to-one name="equipmentInstance" class="org.hisp.dhis.coldchain.inventory.EquipmentInstance" column="equipmentinstanceid"
- foreign-key="fk_equipmentdetails_equipmentmentinstanceid" />
- <key-many-to-one name="inventoryTypeAttribute" class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute" column="inventorytypeattributeid"
- foreign-key="fk_equipmentdetails_inventorytypeattributeid" />
- </composite-id>
-
- <property name="value" />
-
- <many-to-one name="inventoryTypeAttributeOption" class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOption" column="inventorytypeattributeoptionid"
- foreign-key="fk_equipmentdetails_inventorytypeattributeoptionid" />
-
- </class>
-</hibernate-mapping>
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddColdChainCatalogTypeAttributeForm.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddColdChainCatalogTypeAttributeForm.java 2012-04-18 09:24:36 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddColdChainCatalogTypeAttributeForm.java 2012-05-15 10:33:46 +0000
@@ -1,7 +1,5 @@
package org.hisp.dhis.coldchain.catalog.action;
-import org.hisp.dhis.program.Program;
-
import com.opensymphony.xwork2.Action;
public class AddColdChainCatalogTypeAttributeForm implements Action
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/AddEquipmentAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/AddEquipmentAction.java 2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/AddEquipmentAction.java 2012-05-15 10:33:46 +0000
@@ -10,7 +10,7 @@
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.coldchain.catalog.Catalog;
import org.hisp.dhis.coldchain.catalog.CatalogService;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetails;
+import org.hisp.dhis.coldchain.inventory.Equipment;
import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
import org.hisp.dhis.coldchain.inventory.EquipmentInstanceService;
import org.hisp.dhis.coldchain.inventory.InventoryType;
@@ -78,15 +78,15 @@
String value = null;
List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
- List<EquipmentDetails> equipmentDeatilsList = new ArrayList<EquipmentDetails>();
+ List<Equipment> equipmentDeatilsList = new ArrayList<Equipment>();
- EquipmentDetails equipmentDetails = null;
+ Equipment equipmentDetails = null;
for ( InventoryTypeAttribute attribute : inventoryTypeAttributes )
{
value = request.getParameter( PREFIX_ATTRIBUTE + attribute.getId() );
if ( StringUtils.isNotBlank( value ) )
{
- equipmentDetails = new EquipmentDetails();
+ equipmentDetails = new Equipment();
equipmentDetails.setEquipmentInstance( equipmentInstance );
equipmentDetails.setInventoryTypeAttribute( attribute );
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/EquipmentSelectAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/EquipmentSelectAction.java 2012-04-26 10:00:48 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/EquipmentSelectAction.java 2012-05-15 10:33:46 +0000
@@ -79,7 +79,7 @@
}
else
{
- System.out.println("Organisationunit is not null"+ orgUnitId);
+ System.out.println("Organisationunit is not null" + orgUnitId);
}
if( organisationUnit == null && orgUnitId != null )
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceDataAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceDataAction.java 2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceDataAction.java 2012-05-15 10:33:46 +0000
@@ -8,8 +8,8 @@
import org.hisp.dhis.coldchain.catalog.Catalog;
import org.hisp.dhis.coldchain.catalog.CatalogService;
import org.hisp.dhis.coldchain.catalog.CatalogType;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetails;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetailsService;
+import org.hisp.dhis.coldchain.inventory.Equipment;
+import org.hisp.dhis.coldchain.inventory.EquipmentService;
import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
import org.hisp.dhis.coldchain.inventory.EquipmentInstanceService;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
@@ -29,12 +29,13 @@
this.equipmentInstanceService = equipmentInstanceService;
}
- private EquipmentDetailsService equipmentDetailsService;
+ private EquipmentService equipmentService;
+
+ public void setEquipmentService( EquipmentService equipmentService )
+ {
+ this.equipmentService = equipmentService;
+ }
- public void setEquipmentDetailsService( EquipmentDetailsService equipmentDetailsService )
- {
- this.equipmentDetailsService = equipmentDetailsService;
- }
private CatalogService catalogService;
@@ -93,9 +94,9 @@
equipmentValueMap = new HashMap<Integer, String>();
- List<EquipmentDetails> equipmentDetailsList = new ArrayList<EquipmentDetails>( equipmentDetailsService.getEquipmentDetails( equipmentInstance ) );
+ List<Equipment> equipmentDetailsList = new ArrayList<Equipment>( equipmentService.getEquipments( equipmentInstance ) );
- for( EquipmentDetails equipmentDetails : equipmentDetailsList )
+ for( Equipment equipmentDetails : equipmentDetailsList )
{
if ( InventoryTypeAttribute.TYPE_COMBO.equalsIgnoreCase( equipmentDetails.getInventoryTypeAttribute().getValueType() ) )
{
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceListAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceListAction.java 2012-05-14 09:01:41 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceListAction.java 2012-05-15 10:33:46 +0000
@@ -7,8 +7,8 @@
import java.util.List;
import java.util.Map;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetails;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetailsService;
+import org.hisp.dhis.coldchain.inventory.Equipment;
+import org.hisp.dhis.coldchain.inventory.EquipmentService;
import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
import org.hisp.dhis.coldchain.inventory.EquipmentInstanceService;
import org.hisp.dhis.coldchain.inventory.InventoryType;
@@ -53,13 +53,13 @@
this.inventoryTypeAttributeService = inventoryTypeAttributeService;
}
- private EquipmentDetailsService equipmentDetailsService;
-
- public void setEquipmentDetailsService( EquipmentDetailsService equipmentDetailsService )
+ private EquipmentService equipmentService;
+
+ public void setEquipmentService( EquipmentService equipmentService )
{
- this.equipmentDetailsService = equipmentDetailsService;
+ this.equipmentService = equipmentService;
}
-
+
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
@@ -194,7 +194,7 @@
{
for( InventoryTypeAttribute inventoryTypeAttribute1 : inventoryTypeAttributeList )
{
- EquipmentDetails equipmentDetails = equipmentDetailsService.getEquipmentDetails( equipmentInstance, inventoryTypeAttribute1 );
+ Equipment equipmentDetails = equipmentService.getEquipment( equipmentInstance, inventoryTypeAttribute1 );
if( equipmentDetails != null && equipmentDetails.getValue() != null )
{
equipmentDetailsMap.put( equipmentInstance.getId()+":"+inventoryTypeAttribute1.getId(), equipmentDetails.getValue() );
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/UpdateEquipmentAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/UpdateEquipmentAction.java 2012-05-02 09:18:42 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/UpdateEquipmentAction.java 2012-05-15 10:33:46 +0000
@@ -9,8 +9,8 @@
import org.apache.struts2.ServletActionContext;
import org.hisp.dhis.coldchain.catalog.Catalog;
import org.hisp.dhis.coldchain.catalog.CatalogService;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetails;
-import org.hisp.dhis.coldchain.inventory.EquipmentDetailsService;
+import org.hisp.dhis.coldchain.inventory.Equipment;
+import org.hisp.dhis.coldchain.inventory.EquipmentService;
import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
import org.hisp.dhis.coldchain.inventory.EquipmentInstanceService;
import org.hisp.dhis.coldchain.inventory.InventoryType;
@@ -33,7 +33,7 @@
private EquipmentInstanceService equipmentInstanceService;
- private EquipmentDetailsService equipmentDetailsService;
+ private EquipmentService equipmentService;
private CatalogService catalogService;
@@ -51,7 +51,7 @@
public String execute()
{
- System.out.println("inside UpdateEquipmentAction : "+equipmentInstanceID);
+ //System.out.println("inside UpdateEquipmentAction : "+ equipmentInstanceID);
EquipmentInstance equipmentInstance = equipmentInstanceService.getEquipmentInstance( equipmentInstanceID );
@@ -65,16 +65,16 @@
List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
- EquipmentDetails equipmentDetails = null;
+ Equipment equipmentDetails = null;
for ( InventoryTypeAttribute attribute : inventoryTypeAttributes )
{
value = request.getParameter( PREFIX_ATTRIBUTE + attribute.getId() );
- equipmentDetails = equipmentDetailsService.getEquipmentDetails( equipmentInstance, attribute );
+ equipmentDetails = equipmentService.getEquipment( equipmentInstance, attribute );
if( equipmentDetails == null && value != null )
{
- equipmentDetails = new EquipmentDetails();
+ equipmentDetails = new Equipment();
equipmentDetails.setEquipmentInstance( equipmentInstance );
equipmentDetails.setInventoryTypeAttribute( attribute );
@@ -109,7 +109,7 @@
equipmentDetails.setValue( value.trim() );
}
- equipmentDetailsService.addEquipmentDetails( equipmentDetails );
+ equipmentService.addEquipment( equipmentDetails );
}
else
{
@@ -144,7 +144,7 @@
equipmentDetails.setValue( value.trim() );
}
- equipmentDetailsService.updateEquipmentDetails( equipmentDetails );
+ equipmentService.updateEquipment( equipmentDetails );
}
}
@@ -174,9 +174,9 @@
this.equipmentInstanceService = equipmentInstanceService;
}
- public void setEquipmentDetailsService( EquipmentDetailsService equipmentDetailsService )
+ public void setEquipmentService( EquipmentService equipmentService )
{
- this.equipmentDetailsService = equipmentDetailsService;
+ this.equipmentService = equipmentService;
}
public void setEquipmentInstanceID( Integer equipmentInstanceID )
=== modified file 'local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-05-09 07:02:15 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/META-INF/dhis/beans.xml 2012-05-15 10:33:46 +0000
@@ -380,7 +380,7 @@
<property name="equipmentInstanceService" ref="org.hisp.dhis.coldchain.inventory.EquipmentInstanceService" />
<property name="inventoryTypeService" ref="org.hisp.dhis.coldchain.inventory.InventoryTypeService" />
<property name="inventoryTypeAttributeService" ref="org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeService" />
- <property name="equipmentDetailsService" ref="org.hisp.dhis.coldchain.inventory.EquipmentDetailsService" />
+ <property name="equipmentService" ref="org.hisp.dhis.coldchain.inventory.EquipmentService" />
</bean>
<bean id="org.hisp.dhis.coldchain.equipment.action.ShowAddEquipmentFormAction"
class="org.hisp.dhis.coldchain.equipment.action.ShowAddEquipmentFormAction"
@@ -401,14 +401,14 @@
<bean id="org.hisp.dhis.coldchain.equipment.action.GetEquipmentInstanceDataAction"
class="org.hisp.dhis.coldchain.equipment.action.GetEquipmentInstanceDataAction"
scope="prototype">
- <property name="equipmentDetailsService" ref="org.hisp.dhis.coldchain.inventory.EquipmentDetailsService" />
+ <property name="equipmentService" ref="org.hisp.dhis.coldchain.inventory.EquipmentService" />
<property name="equipmentInstanceService" ref="org.hisp.dhis.coldchain.inventory.EquipmentInstanceService" />
<property name="catalogService" ref="org.hisp.dhis.coldchain.catalog.CatalogService" />
</bean>
<bean id="org.hisp.dhis.coldchain.equipment.action.UpdateEquipmentAction"
class="org.hisp.dhis.coldchain.equipment.action.UpdateEquipmentAction"
scope="prototype">
- <property name="equipmentDetailsService" ref="org.hisp.dhis.coldchain.inventory.EquipmentDetailsService" />
+ <property name="equipmentService" ref="org.hisp.dhis.coldchain.inventory.EquipmentService" />
<property name="equipmentInstanceService" ref="org.hisp.dhis.coldchain.inventory.EquipmentInstanceService" />
<property name="inventoryTypeAttributeOptionService" ref="org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOptionService" />
<property name="catalogService" ref="org.hisp.dhis.coldchain.catalog.CatalogService" />