KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > structuretool > actions > RequestSiteNodeVersionUnpublishAction


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.structuretool.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  * This action adds the given siteNodeVersion to the event-list and thereby notifying the
33  * editor.
34  */

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