Subversion Repositories WebE

Compare Revisions

Last modification

Regard whitespace Rev 34 → Rev 33

/trunk/src/ch/ffhs/webE/action/RelationshipTypeAction.java
5,13 → 5,12
 
import javax.servlet.http.HttpServletRequest;
 
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.ServletActionContext;
 
import ch.ffhs.webE.dao.RelationshipTypeDAO;
import ch.ffhs.webE.dao.RelationshipTypeDAOImpl;
import ch.ffhs.webE.domain.RelationshipType;
 
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
24,38 → 23,38
 
private RelationshipType relType = new RelationshipType();
private List<RelationshipType> relTypeList = new ArrayList<RelationshipType>();
private final RelationshipTypeDAO relTypeDAO = new RelationshipTypeDAOImpl();
private RelationshipTypeDAO relTypeDAO = new RelationshipTypeDAOImpl();
 
@Override
public RelationshipType getModel()
{
return this.relType;
return relType;
}
 
public String addOrUpdate()
{
this.relTypeDAO.saveOrUpdateRelType(this.relType);
return Action.SUCCESS;
relTypeDAO.saveOrUpdateRelType(relType);
return SUCCESS;
}
 
public String list()
{
this.relTypeList = this.relTypeDAO.getRelTypes();
return Action.SUCCESS;
relTypeList = relTypeDAO.listRelationshipTypes();
return SUCCESS;
}
 
public String edit()
{
int id = this.getIdParameter();
int id = getIdParameter();
 
if (id > 0)
{
this.relType = this.relTypeDAO.getRelTypeById(id);
return Action.SUCCESS;
relType = relTypeDAO.listRelTypeById(id);
return SUCCESS;
}
else
{
return Action.ERROR;
return ERROR;
}
}
 
67,7 → 66,7
private int getIdParameter()
{
HttpServletRequest request = (HttpServletRequest) ActionContext
.getContext().get(StrutsStatics.HTTP_REQUEST);
.getContext().get(ServletActionContext.HTTP_REQUEST);
 
int id = -1;
try
90,17 → 89,17
*/
public String delete()
{
int id = this.getIdParameter();
int id = getIdParameter();
 
// Check for malicious ID values
if (id > 0)
{
this.relTypeDAO.deleteRelationshipType(id);
return Action.SUCCESS;
relTypeDAO.deleteRelationshipType(id);
return SUCCESS;
}
else
{
return Action.ERROR;
return ERROR;
}
}
 
110,7 → 109,7
 
public RelationshipType getRelType()
{
return this.relType;
return relType;
}
 
public void setRelType(RelationshipType relType)
120,7 → 119,7
 
public List<RelationshipType> getRelTypeList()
{
return this.relTypeList;
return relTypeList;
}
 
public void setRelTypeList(List<RelationshipType> relTypeList)