KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > contenttool > actions > ContentCategoryAction


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 /**
10  * This action will manage the category to content relations
11  *
12  * @author Frank Febbraro (frank@phase2technology.com)
13  */

14 public class ContentCategoryAction extends ModelAction
15 {
16     private static final long serialVersionUID = 9134962841574157622L;
17
18     private ContentCategoryController controller = ContentCategoryController.getController();
19     private Integer JavaDoc contentId;
20     private Integer JavaDoc languageId;
21
22     protected Persistent createModel() { return new ContentCategoryVO(); }
23     public ContentCategoryVO getContentCategory() { return (ContentCategoryVO)getModel(); }
24
25     public Integer JavaDoc getContentCategoryId() { return getContentCategory().getContentCategoryId(); }
26     public void setContentCategoryId(Integer JavaDoc i) { getContentCategory().setContentCategoryId(i); }
27
28     public Integer JavaDoc getContentId() { return contentId; }
29     public void setContentId(Integer JavaDoc i) { contentId = i; }
30
31     public Integer JavaDoc getLanguageId() { return languageId; }
32     public void setLanguageId(Integer JavaDoc i) { languageId = i; }
33
34     public String JavaDoc doAdd() throws SystemException
35     {
36         setModel(controller.save(getContentCategory()));
37         return SUCCESS;
38     }
39
40     public String JavaDoc doDelete() throws SystemException
41     {
42         controller.delete(getContentCategoryId());
43         return SUCCESS;
44     }
45
46     public String JavaDoc doAddStandalone() throws SystemException
47     {
48         setModel(controller.save(getContentCategory()));
49         return SUCCESS;
50     }
51
52     public String JavaDoc doDeleteStandalone() throws SystemException
53     {
54         controller.delete(getContentCategoryId());
55         return SUCCESS;
56     }
57
58
59 }
60
Popular Tags