1
package org.hisp.dhis.coldchain.catalog.action;
3
import java.util.ArrayList;
4
import java.util.Collection;
6
import org.hisp.dhis.coldchain.catalog.CatalogType;
7
import org.hisp.dhis.coldchain.catalog.CatalogTypeAttribute;
8
import org.hisp.dhis.coldchain.catalog.CatalogTypeService;
10
import com.opensymphony.xwork2.Action;
12
public class UpdateCatalogTypeFormAction
15
// -------------------------------------------------------------------------
17
// -------------------------------------------------------------------------
19
private CatalogTypeService catalogTypeService;
21
public void setCatalogTypeService( CatalogTypeService catalogTypeService )
23
this.catalogTypeService = catalogTypeService;
26
// -------------------------------------------------------------------------
28
// -------------------------------------------------------------------------
37
public void setId( int id )
42
private CatalogType catalogType;
44
public CatalogType getCatalogType()
49
private Collection<CatalogTypeAttribute> catalogTypeAttributes;
51
public Collection<CatalogTypeAttribute> getCatalogTypeAttributes()
53
return catalogTypeAttributes;
56
// -------------------------------------------------------------------------
57
// Action implementation
58
// -------------------------------------------------------------------------
60
public String execute() throws Exception
63
//System.out.println( id );
64
catalogType = catalogTypeService.getCatalogType( id );
66
//System.out.println( catalogType.getId() + "-----"+catalogType.getDescription());
68
catalogTypeAttributes = new ArrayList<CatalogTypeAttribute>( catalogType.getCatalogTypeAttributes());
69
//catalogTypeAttributes = catalogType.getCatalogTypeAttributes();
71
//programStage = programStageService.getProgramStage( id );
73
//programStageDataElements = programStage.getProgramStageDataElements();