← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6897: CCEM work in progress

 

------------------------------------------------------------
revno: 6897
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-05-10 11:09:14 +0530
message:
  CCEM work in progress
modified:
  local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeAttributeOptionService.java
  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/org/hisp/dhis/coldchain/hibernate/CatalogTypeAttributeOption.hbm.xml
  local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttributeOption.hbm.xml
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeOptionAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributeListAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributesAction.java
  local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties
  local/in/dhis-web-coldchain/src/main/resources/struts.xml
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateInventoryTypeAttibuteForm.vm


--
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-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeAttributeOptionService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/DefaultCatalogTypeAttributeOptionService.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/DefaultCatalogTypeAttributeOptionService.java	2012-05-10 05:39:14 +0000
@@ -2,8 +2,6 @@
 
 import java.util.Collection;
 
-import org.hisp.dhis.patient.PatientAttribute;
-import org.hisp.dhis.patient.PatientAttributeOption;
 import org.springframework.transaction.annotation.Transactional;
 
 public class DefaultCatalogTypeAttributeOptionService implements CatalogTypeAttributeOptionService

=== 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-09 07:02:15 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/META-INF/dhis/beans.xml	2012-05-10 05:39:14 +0000
@@ -71,7 +71,7 @@
 -->	
     <bean id="org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeStore"
         class="org.hisp.dhis.coldchain.inventory.hibernate.HibernateInventoryTypeAttributeStore">
-		<property name="clazz" value="org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute" />
+		<property name="clazz" value="org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute" />
         <property name="sessionFactory" ref="sessionFactory"/>
 		<property name="cacheable" value="true" />
     </bean>	
@@ -84,7 +84,7 @@
 -->
     <bean id="org.hisp.dhis.coldchain.inventory.InventoryTypeStore"
         class="org.hisp.dhis.coldchain.inventory.hibernate.HibernateInventoryTypeStore">
-        <property name="clazz" value="org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute" />
+        <property name="clazz" value="org.hisp.dhis.coldchain.inventory.InventoryType" />
 		<property name="sessionFactory" ref="sessionFactory"/>
 		<property name="cacheable" value="true" />
     </bean>		

=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/CatalogTypeAttributeOption.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/CatalogTypeAttributeOption.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/CatalogTypeAttributeOption.hbm.xml	2012-05-10 05:39:14 +0000
@@ -9,7 +9,8 @@
       <generator class="native"/>
     </id>
 
-    <property name="name" not-null="true" unique="true" length="160"/>
+    <property name="name" not-null="true" length="160"/>
+	<!--<property name="name" not-null="true" unique="true" length="160"/>-->
     
     <many-to-one name="catalogTypeAttribute" column="catalogtypeattributeid" class="org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute"
       foreign-key="fk_catalogtypeattributeoption_catalogtypeAttributeid" />

=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttributeOption.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttributeOption.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/InventoryTypeAttributeOption.hbm.xml	2012-05-10 05:39:14 +0000
@@ -9,7 +9,8 @@
       <generator class="native"/>
     </id>
 
-    <property name="name" not-null="true" unique="true" length="160"/>
+    <property name="name" not-null="true" length="160"/>
+	<!--<property name="name" not-null="true" unique="true" length="160"/>-->
     
     <many-to-one name="inventoryTypeAttribute" column="inventorytypeattributeid" class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute"
       foreign-key="fk_inventorytypetypeattributeoption_inventorytypeattributeid" />

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogAction.java	2012-04-30 11:24:11 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogAction.java	2012-05-10 05:39:14 +0000
@@ -1,10 +1,6 @@
 package org.hisp.dhis.coldchain.catalog.action;
 
-import java.util.Collection;
-
 import org.hisp.dhis.coldchain.catalog.Catalog;
-import org.hisp.dhis.coldchain.catalog.CatalogDataValue;
-import org.hisp.dhis.coldchain.catalog.CatalogDataValueService;
 import org.hisp.dhis.coldchain.catalog.CatalogService;
 import org.hisp.dhis.common.DeleteNotAllowedException;
 import org.hisp.dhis.i18n.I18n;
@@ -24,7 +20,7 @@
     {
         this.catalogService = catalogService;
     }
-    
+    /*
     private CatalogDataValueService catalogDataValueService;
     
     
@@ -32,7 +28,7 @@
     {
         this.catalogDataValueService = catalogDataValueService;
     }
-    
+    */
 
     // -------------------------------------------------------------------------
     // Input/Output
@@ -66,8 +62,6 @@
     {
         try
         {
-            System.out.println( "Catalog ID is ===  :" + id );
-            
             Catalog catalog = catalogService.getCatalog( id );
             
             //catalogService.deleteCatalogData( catalog );
@@ -88,9 +82,17 @@
                 message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage();
             }
             
+            return INPUT;
+        }
+        
+        catch ( Exception ex )
+        {
+            message = i18n.getString( "object_not_deleted_associated_by_objects" );
+           
             return ERROR;
         }
-
+        
+        
         return SUCCESS;
     }
 }

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeAction.java	2012-04-21 10:23:39 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeAction.java	2012-05-10 05:39:14 +0000
@@ -64,9 +64,17 @@
                 message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage();
             }
             
+            return INPUT;
+        }
+        
+        catch ( Exception ex )
+        {
+            //message = i18n.getString( "object_not_deleted_associated_by_objects" ) + " " + ex.getMessage();
+            message = i18n.getString( "object_not_deleted_associated_by_objects" );
+           
             return ERROR;
         }
-
+        
         return SUCCESS;
     }
 }

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeOptionAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeOptionAction.java	2012-04-21 10:23:39 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/RemoveCatalogTypeAttributeOptionAction.java	2012-05-10 05:39:14 +0000
@@ -59,7 +59,6 @@
     {
         CatalogTypeAttributeOption catalogTypeAttributeOption = catalogTypeAttributeOptionService.getCatalogTypeAttributeOption( id );
        
-        
         if ( catalogTypeAttributeOption != null )
         {
             /*

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributeListAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributeListAction.java	2012-05-09 07:02:15 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributeListAction.java	2012-05-10 05:39:14 +0000
@@ -75,7 +75,7 @@
             
             inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryTypeAttributeService.getInventoryTypeAttributesBetweenByName( key, paging.getStartPos(), paging.getPageSize() ));
         }
-        
+        /*
         else if ( id != null )
         {
             InventoryType inventoryType = inventoryTypeService.getInventoryType( id );
@@ -86,7 +86,7 @@
             
             inventoryTypeAttributes = getBlockElement( inventoryTypeAttributes, paging.getStartPos(), paging.getPageSize() );
         }
-        
+        */
         else
         {
             this.paging = createPaging( inventoryTypeAttributeService.getInventoryTypeAttributeCount() );

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributesAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributesAction.java	2012-05-02 06:03:10 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributesAction.java	2012-05-10 05:39:14 +0000
@@ -4,7 +4,6 @@
 import java.util.Collections;
 import java.util.List;
 
-import org.hisp.dhis.coldchain.catalog.comparator.CatalogTypeComparator;
 import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
 import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeService;
 import org.hisp.dhis.coldchain.inventory.comparator.InventoryTypeAttributeComparator;

=== modified file 'local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties'
--- local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties	2012-05-05 11:16:25 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/org/hisp/dhis/coldchain/i18n_module.properties	2012-05-10 05:39:14 +0000
@@ -33,7 +33,7 @@
 catalogType_attributes = Catalogtype attributes
 edit_catalogType = Edit catalogtype
 catalog_type_details = Details of catalogtype
-object_not_deleted_associated_by_objects = Object not deleted because it is associated by objects of type
+object_not_deleted_associated_by_objects = Object not deleted because it is associated by other objects
 confirm_delete_catalog_type = Are you sure you want to delete this catalogtype?
 duplicate_names = Name is already in use
 no_of_catalogTypeAttributes = Number of catalogtype attributes to be collected

=== modified file 'local/in/dhis-web-coldchain/src/main/resources/struts.xml'
--- local/in/dhis-web-coldchain/src/main/resources/struts.xml	2012-05-04 07:42:28 +0000
+++ local/in/dhis-web-coldchain/src/main/resources/struts.xml	2012-05-10 05:39:14 +0000
@@ -49,7 +49,8 @@
 	<!-- Remove/Delete -->
 	<action name="removeCatalogTypeAttribute" class="org.hisp.dhis.coldchain.catalog.action.RemoveCatalogTypeAttributeAction">
 		<result name="success" type="velocity-json">/dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
-		<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>
+		<result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
+		<result name="error" type="velocity-json">/dhis-web-commons/ajax/jsonResponseError.vm</result>		
 		<param name="requiredAuthorities">F_CATALOGTYPEATTRIBUTE_DELETE</param>
 	</action>
 			
@@ -136,6 +137,7 @@
 	<action name="removeCatalogType" class="org.hisp.dhis.coldchain.catalog.action.RemoveCatalogTypeAction">
 		<result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 		<result name="error" type="velocity-json">../dhis-web-commons/ajax/jsonResponseError.vm</result>
+		<result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
 		<param name="onExceptionReturn">plainTextError</param>
 		<param name="requiredAuthorities">F_CATALOGTYPE_DELETE</param>
 	</action>	
@@ -226,6 +228,7 @@
 	<action name="removeCatalog" class="org.hisp.dhis.coldchain.catalog.action.RemoveCatalogAction">
 		<result name="success" type="velocity-json">../dhis-web-commons/ajax/jsonResponseSuccess.vm</result>
 		<result name="error" type="velocity-json">../dhis-web-commons/ajax/jsonResponseError.vm</result>
+		<result name="input" type="velocity-json">/dhis-web-commons/ajax/jsonResponseInput.vm</result>
 		<param name="onExceptionReturn">plainTextError</param>
 		<param name="requiredAuthorities">F_CATALOG_DELETE</param>
 	</action>	

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateInventoryTypeAttibuteForm.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateInventoryTypeAttibuteForm.vm	2012-05-01 06:15:42 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/updateInventoryTypeAttibuteForm.vm	2012-05-10 05:39:14 +0000
@@ -7,7 +7,6 @@
 <div style="display:inline">
   <input type="hidden" id="id" name="id" value="$inventoryTypeAttribute.id">
 </div>
-  
   <table id="detailsList">
     <thead>
       <tr>