KickJava   Java API By Example, From Geeks To Geeks.

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


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  */

23
24 package org.infoglue.cms.applications.contenttool.actions;
25
26 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
27 import org.infoglue.cms.controllers.kernel.impl.simple.EventController;
28 import org.infoglue.cms.entities.workflow.EventVO;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31
32 /**
33  * This action adds the given contentVersion to the event-list and thereby notifying the
34  * editor.
35  */

36
37 public class RequestContentVersionUnpublishAction extends InfoGlueAbstractAction
38 {
39     private static final long serialVersionUID = 1L;
40     
41     private ConstraintExceptionBuffer ceb;
42     private EventVO eventVO;
43     private Integer JavaDoc repositoryId;
44     private Integer JavaDoc contentId;
45     private Integer JavaDoc languageId;
46           
47     public RequestContentVersionUnpublishAction()
48     {
49         this(new EventVO());
50     }
51     
52     public RequestContentVersionUnpublishAction(EventVO eventVO)
53     {
54         this.eventVO = eventVO;
55         this.ceb = new ConstraintExceptionBuffer();
56     }
57
58     public void setRepositoryId(Integer JavaDoc repositoryId)
59     {
60         this.repositoryId = repositoryId;
61     }
62
63     public Integer JavaDoc getRepositoryId()
64     {
65         return this.repositoryId;
66     }
67
68     public void setContentId(Integer JavaDoc contentId)
69     {
70         this.contentId = contentId;
71     }
72
73     public Integer JavaDoc getContentId()
74     {
75         return this.contentId;
76     }
77
78     public void setLanguageId(Integer JavaDoc languageId)
79     {
80         this.languageId = languageId;
81     }
82
83     public Integer JavaDoc getLanguageId()
84     {
85         return this.languageId;
86     }
87
88     public void setName(String JavaDoc name)
89     {
90         this.eventVO.setName(name);
91     }
92
93     public void setDescription(String JavaDoc description)
94     {
95         this.eventVO.setDescription(description);
96     }
97
98     public String JavaDoc getName()
99     {
100         return this.eventVO.getName();
101     }
102     
103     public void setEntityClass(String JavaDoc entityClass)
104     {
105         this.eventVO.setEntityClass(entityClass);
106     }
107
108     public void setEntityId(Integer JavaDoc entityId)
109     {
110         this.eventVO.setEntityId(entityId);
111     }
112
113     public void setTypeId(Integer JavaDoc typeId)
114     {
115         this.eventVO.setTypeId(typeId);
116     }
117       
118     public String JavaDoc doExecute() throws Exception JavaDoc
119     {
120         ceb = this.eventVO.validate();
121         ceb.throwIfNotEmpty();
122         
123         EventController.create(this.eventVO, this.repositoryId, this.getInfoGluePrincipal());
124         
125         return "success";
126     }
127         
128 }
129
Popular Tags