1 package org.infoglue.cms.applications.contenttool.actions; 2 3 import org.infoglue.cms.applications.common.actions.ModelAction; 4 import org.infoglue.cms.controllers.kernel.impl.simple.ContentCategoryController; 5 import org.infoglue.cms.entities.content.ContentCategoryVO; 6 import org.infoglue.cms.entities.kernel.Persistent; 7 import org.infoglue.cms.exception.SystemException; 8 9 14 public class ContentCategoryAction extends ModelAction 15 { 16 private static final long serialVersionUID = 9134962841574157622L; 17 18 private ContentCategoryController controller = ContentCategoryController.getController(); 19 private Integer contentId; 20 private Integer languageId; 21 22 protected Persistent createModel() { return new ContentCategoryVO(); } 23 public ContentCategoryVO getContentCategory() { return (ContentCategoryVO)getModel(); } 24 25 public Integer getContentCategoryId() { return getContentCategory().getContentCategoryId(); } 26 public void setContentCategoryId(Integer i) { getContentCategory().setContentCategoryId(i); } 27 28 public Integer getContentId() { return contentId; } 29 public void setContentId(Integer i) { contentId = i; } 30 31 public Integer getLanguageId() { return languageId; } 32 public void setLanguageId(Integer i) { languageId = i; } 33 34 public String doAdd() throws SystemException 35 { 36 setModel(controller.save(getContentCategory())); 37 return SUCCESS; 38 } 39 40 public String doDelete() throws SystemException 41 { 42 controller.delete(getContentCategoryId()); 43 return SUCCESS; 44 } 45 46 public String doAddStandalone() throws SystemException 47 { 48 setModel(controller.save(getContentCategory())); 49 return SUCCESS; 50 } 51 52 public String doDeleteStandalone() throws SystemException 53 { 54 controller.delete(getContentCategoryId()); 55 return SUCCESS; 56 } 57 58 59 } 60 | Popular Tags |