← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6893: CCEM: Added sorting functionlity for CatalogTypeAttributes

 

------------------------------------------------------------
revno: 6893
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-05-09 17:38:52 +0530
message:
  CCEM: Added sorting functionlity for CatalogTypeAttributes
modified:
  dhis-2/dhis-web/dhis-web-portal/india-pom.xml
  local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogType.java
  local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttribute.java
  local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/CatalogType.hbm.xml
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogFormAction.java
  local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java
  local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.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 'dhis-2/dhis-web/dhis-web-portal/india-pom.xml'
--- dhis-2/dhis-web/dhis-web-portal/india-pom.xml	2012-02-20 12:01:56 +0000
+++ dhis-2/dhis-web/dhis-web-portal/india-pom.xml	2012-05-09 12:08:52 +0000
@@ -6,7 +6,7 @@
   <parent>
     <groupId>org.hisp.dhis</groupId>
     <artifactId>dhis-web</artifactId>
-    <version>2.8-SNAPSHOT</version>
+    <version>2.8</version>
   </parent>
   
   <artifactId>dhis-web-india-portal</artifactId>
@@ -141,12 +141,14 @@
       <version>${project.version}</version>
       <type>war</type>
     </dependency>
+	<!--
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-api-mobile</artifactId>
       <version>${project.version}</version>
       <type>war</type>
     </dependency>
+	-->
     <dependency>
       <groupId>org.hisp.dhis</groupId>
       <artifactId>dhis-web-light</artifactId>
@@ -199,6 +201,12 @@
       <type>war</type>
     </dependency>
 
+	<dependency>
+      <groupId>org.hisp.dhis</groupId>
+      <artifactId>dhis-web-coldchain</artifactId>
+      <version>${project.version}</version>
+      <type>war</type>
+    </dependency>
 <!-- SMS Mobile application -->
 <!--
     <dependency>

=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogType.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogType.java	2012-05-09 07:02:15 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogType.java	2012-05-09 12:08:52 +0000
@@ -1,8 +1,11 @@
 package org.hisp.dhis.coldchain.catalog;
 
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.hisp.dhis.common.BaseNameableObject;
+import org.hisp.dhis.common.annotation.Scanned;
+import org.hisp.dhis.dataentryform.DataEntryForm;
 
 //public class CatalogType implements Serializable
 public class CatalogType extends BaseNameableObject
@@ -18,7 +21,9 @@
     
     private String description;
     
-    private Set<CatalogTypeAttribute> catalogTypeAttributes;
+    private List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>();
+	
+    private DataEntryForm dataEntryForm;
     
     // -------------------------------------------------------------------------
     // Contructors
@@ -99,13 +104,22 @@
     {
         this.description = description;
     }
-    public Set<CatalogTypeAttribute> getCatalogTypeAttributes()
+
+    public DataEntryForm getDataEntryForm()
+    {
+        return dataEntryForm;
+    }
+    public void setDataEntryForm( DataEntryForm dataEntryForm )
+    {
+        this.dataEntryForm = dataEntryForm;
+    }
+    public List<CatalogTypeAttribute> getCatalogTypeAttributes()
     {
         return catalogTypeAttributes;
     }
-    public void setCatalogTypeAttributes( Set<CatalogTypeAttribute> catalogTypeAttributes )
+    public void setCatalogTypeAttributes( List<CatalogTypeAttribute> catalogTypeAttributes )
     {
         this.catalogTypeAttributes = catalogTypeAttributes;
     }
-
+    
 }

=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttribute.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttribute.java	2012-05-07 11:49:40 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/catalog/CatalogTypeAttribute.java	2012-05-09 12:08:52 +0000
@@ -1,5 +1,6 @@
 package org.hisp.dhis.coldchain.catalog;
 
+import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.common.BaseNameableObject;
@@ -156,6 +157,4 @@
         this.attributeOptions = attributeOptions;
     }
 
-    
-    
 }

=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/CatalogType.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/CatalogType.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/CatalogType.hbm.xml	2012-05-09 12:08:52 +0000
@@ -13,12 +13,23 @@
     
     <property name="description" not-null="false" length="250"/>
 	
+	<!--
 	<set name="catalogTypeAttributes" table="catalogtype_attributes">
       <key column="catalogtypeid" foreign-key="fk_catalogtype_attributes_catalogtypeid" />
       <many-to-many class="org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute" column="catalogtypeattributeid"
           foreign-key="fk_catalogtype_attributes_catalogtypeattribtueid" />
     </set>
+	-->
 	
+	<list name="catalogTypeAttributes" table="catalogtype_attributes">
+		<key column="catalogtypeid" foreign-key="fk_catalogtype_attributes_catalogtypeid" />					 
+        <list-index column="sort_order" base="0" />
+        <many-to-many class="org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute" column="catalogtypeattributeid"
+			foreign-key="fk_catalogtype_attributes_catalogtypeattribtueid" />
+	</list>
+
+    <many-to-one name="dataEntryForm" class="org.hisp.dhis.dataentryform.DataEntryForm"
+      foreign-key="fk_catalogtype_dataentryform" />
 
   </class>
 </hibernate-mapping>

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java	2012-04-25 05:52:37 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/AddCatalogTypeAction.java	2012-05-09 12:08:52 +0000
@@ -74,7 +74,7 @@
         //catalogType.getCatalogTypeAttributes().add( arg0 )
         //catalogTypeService.addCatalogType( catalogType );
        
-        Set<CatalogTypeAttribute> catalogTypeAttributes = new HashSet<CatalogTypeAttribute>();
+        List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>();
         
         for ( int i = 0; i < this.selectedCatalogTypeAttributesValidator.size(); i++ )
         {

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java	2012-05-03 07:02:57 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/ShowAddCatalogFormAction.java	2012-05-09 12:08:52 +0000
@@ -64,7 +64,7 @@
         //catalogTypeAttributes =  catalogType.getCatalogTypeAttributes();
         
         catalogTypeAttributes = new ArrayList<CatalogTypeAttribute> ( catalogType.getCatalogTypeAttributes());
-        Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
+        //Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
         
         /*
         System.out.println( "Name of CatalogType is ======  :" + catalogType.getName() );

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogFormAction.java	2012-05-04 09:05:30 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogFormAction.java	2012-05-09 12:08:52 +0000
@@ -119,9 +119,7 @@
         //catalogTypeAttributes = catalogType.getCatalogTypeAttributes();
         
         catalogTypeAttributes = new ArrayList<CatalogTypeAttribute> ( catalogType.getCatalogTypeAttributes());
-        Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
-        
-        
+        //Collections.sort( catalogTypeAttributes, new CatalogTypeAttributeComparator() );
         
         List<CatalogDataValue> catalogDataValues = new ArrayList<CatalogDataValue>( catalogDataValueService.getAllCatalogDataValuesByCatalog( catalogService.getCatalog( id )) );
         

=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java	2012-04-25 09:03:17 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/catalog/action/UpdateCatalogTypeAction.java	2012-05-09 12:08:52 +0000
@@ -86,7 +86,7 @@
         }
         //catalogType.getCatalogTypeAttributes().clear();
         
-        Set<CatalogTypeAttribute> catalogTypeAttributes = new HashSet<CatalogTypeAttribute>( );
+        List<CatalogTypeAttribute> catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>( );
         
         
         

=== modified file 'local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm'
--- local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm	2012-05-09 07:02:15 +0000
+++ local/in/dhis-web-coldchain/src/main/webapp/dhis-web-coldchain/catalogTypeList.vm	2012-05-09 12:08:52 +0000
@@ -38,6 +38,7 @@
                 <td style="text-align:right">
                   <a href="editCatalogTypeForm.action?id=$catalogType.id" title="$i18n.getString( 'edit' )"><img src="../images/edit.png" alt="$i18n.getString( 'edit' )"/></a>
                   <a href="javascript:removeItem( '$catalogType.id', '$encoder.jsEncode( $catalogType.name )', i18n_confirm_delete , 'removeCatalogType.action' )" title="$i18n.getString( "remove" )"><img src="../images/delete.png" alt="$i18n.getString( "remove" )"></a>
+				  <a href="viewCatalogTypeDataEntryForm.action?catalogTypeId=$catalogType.id" title="$i18n.getString( "design_data_entry_form" )"><img src="../images/edit_layout.png" alt="$i18n.getString( "design_data_entry_form" )"></a>					
                   <a href="javascript:showCalatogTypeDetails( $catalogType.id )" title="$i18n.getString( 'show_details' )"><img src="../images/information.png" alt="$i18n.getString( 'show_details' )"/></a>
                 </td>
               </tr>