dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #17934
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7344: Removed duplicate property for inventorytype_attribute
------------------------------------------------------------
revno: 7344
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-06-21 10:47:23 +0100
message:
Removed duplicate property for inventorytype_attribute
modified:
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryTypeAttribute.java
local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType_Attribute.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultInventoryTypeService.java
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType.hbm.xml
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttribute.hbm.xml
local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType_Attribute.hbm.xml
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/GetEquipmentInstanceDataAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowAddEquipmentFormAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowEquipmentDataEntryFormAction.java
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/inventory/action/AddInventoryTypeAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAttributeAction.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/UpdateInventoryTypeAction.java
local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAttributeAction.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
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType.java 2012-06-18 09:15:09 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType.java 2012-06-21 09:47:23 +0000
@@ -1,8 +1,6 @@
package org.hisp.dhis.coldchain.inventory;
-import java.util.ArrayList;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import org.hisp.dhis.coldchain.catalog.CatalogType;
@@ -26,35 +24,20 @@
private boolean tracking;
-
-
private CatalogType catalogType;
// private Set<InventoryTypeAttribute> inventoryTypeAttributes;
- private List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>();
+ //private List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>();
- private List<Boolean> display = new ArrayList<Boolean>();
+ //private List<Boolean> display = new ArrayList<Boolean>();
private Set<InventoryType_Attribute> inventoryType_Attributes;
-
- /**
- * All DataSets associated with this InventoryType.
- */
private Set<DataSet> dataSets = new HashSet<DataSet>();
-
-
-
private DataEntryForm dataEntryForm;
- /*
- * True if this InventoryTypeAttribute is for display in list
- */
- //private boolean display = false;
-
-
// -------------------------------------------------------------------------
// Contructors
// -------------------------------------------------------------------------
@@ -77,8 +60,6 @@
this.catalogType = catalogType;
}
-
-
// -------------------------------------------------------------------------
// hashCode, equals and toString
// -------------------------------------------------------------------------
@@ -165,6 +146,7 @@
this.inventoryTypeAttributes = inventoryTypeAttributes;
}
*/
+ /*
public List<InventoryTypeAttribute> getInventoryTypeAttributes()
{
return inventoryTypeAttributes;
@@ -173,6 +155,7 @@
{
this.inventoryTypeAttributes = inventoryTypeAttributes;
}
+ */
public DataEntryForm getDataEntryForm()
{
return dataEntryForm;
@@ -210,6 +193,4 @@
this.inventoryType_Attributes = inventoryType_Attributes;
}
-
-
}
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryTypeAttribute.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryTypeAttribute.java 2012-06-18 09:15:09 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryTypeAttribute.java 2012-06-21 09:47:23 +0000
@@ -38,7 +38,7 @@
/*
* True if this InventoryTypeAttribute is for display in list
*/
- private boolean display = false;
+ //private boolean display = false;
private Integer noChars;
@@ -172,6 +172,7 @@
attributeOptions.add( option );
}
+ /*
public boolean isDisplay()
{
return display;
@@ -181,4 +182,5 @@
{
this.display = display;
}
+ */
}
=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType_Attribute.java'
--- local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType_Attribute.java 2012-06-18 09:15:09 +0000
+++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/coldchain/inventory/InventoryType_Attribute.java 2012-06-21 09:47:23 +0000
@@ -97,49 +97,39 @@
return inventoryType;
}
-
public void setInventoryType( InventoryType inventoryType )
{
this.inventoryType = inventoryType;
}
-
public InventoryTypeAttribute getInventoryTypeAttribute()
{
return inventoryTypeAttribute;
}
-
public void setInventoryTypeAttribute( InventoryTypeAttribute inventoryTypeAttribute )
{
this.inventoryTypeAttribute = inventoryTypeAttribute;
}
-
public boolean isDisplay()
{
return display;
}
-
public void setDisplay( boolean display )
{
this.display = display;
}
-
public Integer getSortOrder()
{
return sortOrder;
}
-
public void setSortOrder( Integer sortOrder )
{
this.sortOrder = sortOrder;
}
-
-
-
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultInventoryTypeService.java'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultInventoryTypeService.java 2012-05-16 07:06:15 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/DefaultInventoryTypeService.java 2012-06-21 09:47:23 +0000
@@ -29,7 +29,6 @@
{
i18nService = service;
}
-
// -------------------------------------------------------------------------
// InventoryType
@@ -74,7 +73,6 @@
}
*/
-
@Override
public int addInventoryType( InventoryType inventoryType )
@@ -93,23 +91,25 @@
{
inventoryTypeStore.update( inventoryType );
}
+
@Override
public Collection<InventoryType> getAllInventoryTypes()
{
return inventoryTypeStore.getAllInventoryTypes();
}
+
@Override
public InventoryType getInventoryTypeByName( String name )
{
return inventoryTypeStore.getInventoryTypeByName( name );
}
+
@Override
public InventoryType getInventoryType( int id )
{
return inventoryTypeStore.getInventoryType( id );
}
-
//Methods
public int getInventoryTypeCount()
{
@@ -139,13 +139,14 @@
public Collection<InventoryTypeAttribute> getAllInventoryTypeAttributesForDisplay( InventoryType inventoryType )
{
List<InventoryTypeAttribute> inventoryTypeAttributeList = new ArrayList<InventoryTypeAttribute>();
- List<InventoryTypeAttribute> tempInventoryTypeAttributeList = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
-
- for ( InventoryTypeAttribute inventoryTypeAttribute : tempInventoryTypeAttributeList )
+
+ List<InventoryType_Attribute> inventoryType_AttributeList = new ArrayList<InventoryType_Attribute>( inventoryType.getInventoryType_Attributes() );
+ for ( InventoryType_Attribute inventoryType_Attribute : inventoryType_AttributeList )
{
- if ( inventoryTypeAttribute.isDisplay())
+
+ if ( inventoryType_Attribute.isDisplay() )
{
- inventoryTypeAttributeList.add( inventoryTypeAttribute );
+ inventoryTypeAttributeList.add( inventoryType_Attribute.getInventoryTypeAttribute() );
}
}
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType.hbm.xml 2012-06-18 09:15:09 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType.hbm.xml 2012-06-21 09:47:23 +0000
@@ -18,8 +18,6 @@
<property name="tracking" column="tracking" />
-
-
<set name="dataSets" table="inventorytype_datasets">
<key column="inventorytypeid" foreign-key="fk_inventorytype_datasets_inventorytypeid" />
<many-to-many class="org.hisp.dhis.dataset.DataSet" column="datasetid"
@@ -40,12 +38,15 @@
foreign-key="fk_inventorytype_attributes_inventorytypeattributeid" />
</set>
-->
+
+<!--
<list name="inventoryTypeAttributes" table="inventorytype_attributes">
<key column="inventorytypeid" foreign-key="fk_inventorytype_attributes_inventorytypeid" />
<list-index column="sort_order" base="0" />
<many-to-many class="org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute" column="inventorytypeattributeid"
foreign-key="fk_inventorytype_attributes_inventorytypeattributeid" />
</list>
+-->
<many-to-one name="dataEntryForm" class="org.hisp.dhis.dataentryform.DataEntryForm"
foreign-key="fk_inventorytype_dataentryform" />
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttribute.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttribute.hbm.xml 2012-05-16 07:06:15 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryTypeAttribute.hbm.xml 2012-06-21 09:47:23 +0000
@@ -17,7 +17,7 @@
<property name="mandatory" column="mandatory" not-null="true" />
- <property name="display" column="display" not-null="true" />
+ <!--<property name="display" column="display" not-null="true" /> -->
<property name="noChars" />
=== modified file 'local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType_Attribute.hbm.xml'
--- local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType_Attribute.hbm.xml 2012-06-18 09:15:09 +0000
+++ local/in/dhis-in-services/dhis-in-service-coldchain/src/main/resources/org/hisp/dhis/coldchain/hibernate/InventoryType_Attribute.hbm.xml 2012-06-21 09:47:23 +0000
@@ -4,7 +4,7 @@
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
- <class name="org.hisp.dhis.coldchain.inventory.InventoryType_Attribute" table="inventorytype_attribute_display">
+ <class name="org.hisp.dhis.coldchain.inventory.InventoryType_Attribute" table="inventorytype_attributes">
<composite-id>
<key-many-to-one name="inventoryType" class="org.hisp.dhis.coldchain.inventory.InventoryType" column="inventorytypeid"
=== 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-06-13 06:35:38 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/AddEquipmentAction.java 2012-06-21 09:47:23 +0000
@@ -18,6 +18,7 @@
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOption;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOptionService;
import org.hisp.dhis.coldchain.inventory.InventoryTypeService;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -101,7 +102,12 @@
HttpServletRequest request = ServletActionContext.getRequest();
String value = null;
- List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
+ List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( );
+ for( InventoryType_Attribute inventoryType_Attribute : inventoryType.getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributes.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
+
List<Equipment> equipmentDeatilsList = new ArrayList<Equipment>();
Equipment equipmentDetails = 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-06-18 09:15:09 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/GetEquipmentInstanceDataAction.java 2012-06-21 09:47:23 +0000
@@ -13,6 +13,7 @@
import org.hisp.dhis.coldchain.inventory.EquipmentInstance;
import org.hisp.dhis.coldchain.inventory.EquipmentInstanceService;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import com.opensymphony.xwork2.Action;
@@ -112,7 +113,11 @@
equipmentInstanceCatalogId = 0;
}
- inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( equipmentInstance.getInventoryType().getInventoryTypeAttributes() );
+ inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( );
+ for( InventoryType_Attribute inventoryType_Attribute : equipmentInstance.getInventoryType().getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributes.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
equipmentValueMap = new HashMap<Integer, String>();
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowAddEquipmentFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowAddEquipmentFormAction.java 2012-05-14 09:25:17 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowAddEquipmentFormAction.java 2012-06-21 09:47:23 +0000
@@ -9,6 +9,7 @@
import org.hisp.dhis.coldchain.inventory.InventoryType;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
import org.hisp.dhis.coldchain.inventory.InventoryTypeService;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
@@ -97,7 +98,11 @@
inventoryType = inventoryTypeService.getInventoryType( Integer.parseInt( inventoryTypeId ) );
- inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
+ inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( );
+ for( InventoryType_Attribute inventoryType_Attribute : inventoryType.getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributes.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
CatalogType catalogType = inventoryType.getCatalogType();
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowEquipmentDataEntryFormAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowEquipmentDataEntryFormAction.java 2012-05-23 06:35:17 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/ShowEquipmentDataEntryFormAction.java 2012-06-21 09:47:23 +0000
@@ -12,6 +12,7 @@
import org.hisp.dhis.coldchain.inventory.InventoryType;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
import org.hisp.dhis.coldchain.inventory.InventoryTypeService;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import org.hisp.dhis.coldchain.inventory.comparator.InventoryTypeAttributeMandatoryComparator;
import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.dataset.DataSet;
@@ -168,7 +169,12 @@
if( inventoryTypeAttributeList == null || inventoryTypeAttributeList.size() == 0 )
{
- inventoryTypeAttributeList = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
+ inventoryTypeAttributeList = new ArrayList<InventoryTypeAttribute>( );
+ for( InventoryType_Attribute inventoryType_Attribute : inventoryType.getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributeList.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
+
Collections.sort( inventoryTypeAttributeList, new InventoryTypeAttributeMandatoryComparator() );
if( inventoryTypeAttributeList != null && inventoryTypeAttributeList.size() > 3 )
{
=== 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-06-13 06:35:38 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/equipment/action/UpdateEquipmentAction.java 2012-06-21 09:47:23 +0000
@@ -17,6 +17,7 @@
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOption;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeOptionService;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import com.opensymphony.xwork2.Action;
@@ -83,7 +84,12 @@
HttpServletRequest request = ServletActionContext.getRequest();
String value = null;
- List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
+ List<InventoryTypeAttribute> inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( );
+
+ for( InventoryType_Attribute inventoryType_Attribute : inventoryType.getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributes.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
Equipment equipmentDetails = null;
for ( InventoryTypeAttribute attribute : inventoryTypeAttributes )
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAction.java 2012-06-18 09:15:09 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAction.java 2012-06-21 09:47:23 +0000
@@ -25,12 +25,14 @@
{
this.inventoryTypeService = inventoryTypeService;
}
+
private CatalogTypeService catalogTypeService;
public void setCatalogTypeService( CatalogTypeService catalogTypeService )
{
this.catalogTypeService = catalogTypeService;
}
+
private InventoryTypeAttributeService inventoryTypeAttributeService;
public void setInventoryTypeAttributeService( InventoryTypeAttributeService inventoryTypeAttributeService )
@@ -98,7 +100,6 @@
this.display = display;
}
-
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -138,28 +139,19 @@
*/
}
- inventoryType.setInventoryTypeAttributes( inventoryTypeSet );
+ //inventoryType.setInventoryTypeAttributes( inventoryTypeSet );
inventoryTypeService.addInventoryType( inventoryType );
-
if ( selectedInventoryTypeAttributeValidator != null && selectedInventoryTypeAttributeValidator.size() > 0 )
{
for ( int i = 0; i < this.selectedInventoryTypeAttributeValidator.size(); i++ )
{
-
InventoryTypeAttribute inventoryTypeAttribute = inventoryTypeAttributeService.getInventoryTypeAttribute( selectedInventoryTypeAttributeValidator.get( i ) );
InventoryType_Attribute inventoryType_Attribute = new InventoryType_Attribute( inventoryType, inventoryTypeAttribute, this.display.get( i ), new Integer( i ) );
- /*
- System.out.println( "ID---" + inventoryType_Attribute.getInventoryTypeAttribute().getId() );
- System.out.println( "Name---" + inventoryType_Attribute.getInventoryTypeAttribute().getName());
- System.out.println( "ValueType---" + inventoryType_Attribute.getInventoryTypeAttribute().getValueType() );
- System.out.println( "Sort Order---" + inventoryType_Attribute.getSortOrder() );
- System.out.println( "Display---" + inventoryType_Attribute.isDisplay());
- */
- inventoryType_AttributeService.addInventoryType_Attribute( inventoryType_Attribute );
+ inventoryType_AttributeService.addInventoryType_Attribute( inventoryType_Attribute );
}
}
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAttributeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAttributeAction.java 2012-05-16 07:06:15 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/AddInventoryTypeAttributeAction.java 2012-06-21 09:47:23 +0000
@@ -99,7 +99,7 @@
inventoryTypeAttribute.setMandatory( mandatory );
inventoryTypeAttribute.setNoChars( noChars );
inventoryTypeAttribute.setValueType( valueType );
- inventoryTypeAttribute.setDisplay( display );
+ //inventoryTypeAttribute.setDisplay( display );
inventoryTypeAttributeService.addInventoryTypeAttribute( inventoryTypeAttribute );
=== 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-06-06 12:05:02 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/GetInventoryTypeAttributeListAction.java 2012-06-21 09:47:23 +0000
@@ -10,6 +10,7 @@
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttribute;
import org.hisp.dhis.coldchain.inventory.InventoryTypeAttributeService;
import org.hisp.dhis.coldchain.inventory.InventoryTypeService;
+import org.hisp.dhis.coldchain.inventory.InventoryType_Attribute;
import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.paging.ActionPagingSupport;
@@ -80,7 +81,12 @@
{
InventoryType inventoryType = inventoryTypeService.getInventoryType( id );
- inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>( inventoryType.getInventoryTypeAttributes() );
+ inventoryTypeAttributes = new ArrayList<InventoryTypeAttribute>();
+
+ for( InventoryType_Attribute inventoryType_Attribute : inventoryType.getInventoryType_Attributes() )
+ {
+ inventoryTypeAttributes.add( inventoryType_Attribute.getInventoryTypeAttribute() );
+ }
}
else
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAction.java 2012-06-18 09:15:09 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAction.java 2012-06-21 09:47:23 +0000
@@ -125,10 +125,12 @@
inventoryType.setCatalogType( catalogTypeService.getCatalogType( catalogType ) );
}
+ /*
if( inventoryType != null )
{
inventoryType.getInventoryTypeAttributes().clear();
}
+ */
//Set<InventoryTypeAttribute> inventoryTypeSet = new HashSet<InventoryTypeAttribute>();
@@ -140,24 +142,11 @@
for ( int i = 0; i < this.selectedInventoryTypeAttributeValidator.size(); i++ )
{
InventoryTypeAttribute inventoryTypeAttribute = inventoryTypeAttributeService.getInventoryTypeAttribute( selectedInventoryTypeAttributeValidator.get( i ) );
- /*
- System.out.println( "ID---" + inventoryTypeAttribute.getId() );
- System.out.println( "Name---" + inventoryTypeAttribute.getName());
- System.out.println( "ValueType---" + inventoryTypeAttribute.getValueType() );
- */
inventoryTypeList.add( inventoryTypeAttribute );
-
- //inventoryTypeSet.add( inventoryTypeAttributeService.getInventoryTypeAttribute( selectedInventoryTypeAttributeList.get( i ) ) );
- }
- /*
- for( Integer inventoryTypeAttId : selectedInventoryTypeAttributeList )
- {
- inventoryType.getInventoryTypeAttributes().add( inventoryTypeAttributeService.getInventoryTypeAttribute( inventoryTypeAttId ) );
- }
- */
+ }
}
- inventoryType.setInventoryTypeAttributes( inventoryTypeList );
+ //inventoryType.setInventoryTypeAttributes( inventoryTypeList );
inventoryTypeService.updateInventoryType( inventoryType );
// for InventoryType_Attribute
@@ -167,15 +156,11 @@
for ( int i = 0; i < this.selectedInventoryTypeAttributeValidator.size(); i++ )
{
InventoryTypeAttribute inventoryTypeAttribute = inventoryTypeAttributeService.getInventoryTypeAttribute( selectedInventoryTypeAttributeValidator.get( i ) );
-
-
InventoryType_Attribute inventoryType_Attribute = inventoryType_AttributeService.getInventoryTypeAttribute( inventoryType, inventoryTypeAttribute );
-
if ( inventoryType_Attribute == null )
{
-
inventoryType_Attribute = new InventoryType_Attribute( inventoryType, inventoryTypeAttribute, this.display.get( i ), new Integer( i ) );
inventoryType_AttributeService.addInventoryType_Attribute( inventoryType_Attribute );
}
@@ -184,7 +169,6 @@
inventoryType_Attribute.setDisplay( this.display.get( i ) );
inventoryType_Attribute.setSortOrder( new Integer( i ) );
-
inventoryType_AttributeService.updateInventoryType_Attribute( inventoryType_Attribute );
=== modified file 'local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAttributeAction.java'
--- local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAttributeAction.java 2012-05-16 07:06:15 +0000
+++ local/in/dhis-web-coldchain/src/main/java/org/hisp/dhis/coldchain/inventory/action/UpdateInventoryTypeAttributeAction.java 2012-06-21 09:47:23 +0000
@@ -109,7 +109,7 @@
inventoryTypeAttribute.setMandatory( mandatory );
inventoryTypeAttribute.setNoChars( noChars );
inventoryTypeAttribute.setValueType( valueType );
- inventoryTypeAttribute.setDisplay( display );
+ //inventoryTypeAttribute.setDisplay( display );
HttpServletRequest request = ServletActionContext.getRequest();
Collection<InventoryTypeAttributeOption> attributeOptions = inventoryTypeAttributeOptionService.get( inventoryTypeAttribute );