1 package org.infoglue.cms.applications.managementtool.actions; 2 3 import org.infoglue.cms.applications.common.actions.ModelAction; 4 import org.infoglue.cms.controllers.kernel.impl.simple.PropertiesCategoryController; 5 import org.infoglue.cms.entities.kernel.Persistent; 6 import org.infoglue.cms.entities.management.PropertiesCategoryVO; 7 import org.infoglue.cms.exception.SystemException; 8 9 14 public class PropertiesCategoryAction extends ModelAction 15 { 16 private PropertiesCategoryController controller = PropertiesCategoryController.getController(); 17 private Integer propertiesId; 18 private Integer languageId; 19 private String returnAddress; 20 21 protected Persistent createModel() { return new PropertiesCategoryVO(); } 22 23 public PropertiesCategoryVO getPropertiesCategory() { return (PropertiesCategoryVO)getModel(); } 24 25 public Integer getPropertiesCategoryId() { return getPropertiesCategory().getPropertiesCategoryId(); } 26 public void setPropertiesCategoryId(Integer i) { getPropertiesCategory().setPropertiesCategoryId(i); } 27 28 public Integer getPropertiesId() { return propertiesId; } 29 public void setPropertiesId(Integer i) { propertiesId = i; } 30 31 public Integer getLanguageId() { return languageId; } 32 public void setLanguageId(Integer i) { languageId = i; } 33 34 public String getReturnAddress() 35 { 36 return returnAddress; 37 } 38 39 public void setReturnAddress(String returnAddress) 40 { 41 this.returnAddress = returnAddress; 42 } 43 44 public String doAdd() throws SystemException, Exception 45 { 46 setModel(controller.save(getPropertiesCategory())); 47 48 this.getResponse().sendRedirect(returnAddress); 49 50 return NONE; 51 } 52 53 public String doDelete() throws SystemException, Exception 54 { 55 controller.delete(getPropertiesCategoryId()); 56 57 this.getResponse().sendRedirect(returnAddress); 58 59 return NONE; 60 } 61 } 62 | Popular Tags |