KickJava   Java API By Example, From Geeks To Geeks.

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


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.SiteNodeControllerProxy;
28 import org.infoglue.cms.entities.structure.SiteNodeVO;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31 /**
32  * This action represents the CreateSiteNode Usecase.
33  */

34
35 public class MoveSiteNodeAction extends InfoGlueAbstractAction
36 {
37
38     private Integer JavaDoc siteNodeId;
39     private Integer JavaDoc parentSiteNodeId;
40     private Integer JavaDoc newParentSiteNodeId;
41     private Integer JavaDoc repositoryId;
42     private Integer JavaDoc changeTypeId;
43     private ConstraintExceptionBuffer ceb;
44     private SiteNodeVO siteNodeVO;
45   
46   
47     public MoveSiteNodeAction()
48     {
49         this(new SiteNodeVO());
50     }
51     
52     public MoveSiteNodeAction(SiteNodeVO siteNodeVO)
53     {
54         this.siteNodeVO = siteNodeVO;
55         this.ceb = new ConstraintExceptionBuffer();
56     }
57
58     public void setSiteNodeId(Integer JavaDoc siteNodeId)
59     {
60         this.siteNodeVO.setSiteNodeId(siteNodeId);
61     }
62
63     public void setNewParentSiteNodeId(Integer JavaDoc newParentSiteNodeId)
64     {
65         this.newParentSiteNodeId = newParentSiteNodeId;
66     }
67
68     public void setParentSiteNodeId(Integer JavaDoc parentSiteNodeId)
69     {
70         this.parentSiteNodeId = parentSiteNodeId;
71     }
72
73     public void setChangeTypeId(Integer JavaDoc changeTypeId)
74     {
75         this.changeTypeId = changeTypeId;
76     }
77
78     public Integer JavaDoc getParentSiteNodeId()
79     {
80         return this.parentSiteNodeId;
81     }
82     
83     public Integer JavaDoc getRepositoryId()
84     {
85         return this.repositoryId;
86     }
87
88     public void setRepositoryId(Integer JavaDoc repositoryId)
89     {
90         this.repositoryId = repositoryId;
91     }
92         
93     public Integer JavaDoc getSiteNodeId()
94     {
95         return siteNodeVO.getSiteNodeId();
96     }
97
98     public Integer JavaDoc getNewParentSiteNodeId()
99     {
100         return this.newParentSiteNodeId;
101     }
102     
103     public Integer JavaDoc getUnrefreshedSiteNodeId()
104     {
105         return this.newParentSiteNodeId;
106     }
107
108     public Integer JavaDoc getChangeTypeId()
109     {
110         return this.changeTypeId;
111     }
112       
113     public String JavaDoc doExecute() throws Exception JavaDoc
114     {
115         ceb.throwIfNotEmpty();
116         
117         //SiteNodeController.moveSiteNode(this.siteNodeVO, this.newParentSiteNodeId);
118
SiteNodeControllerProxy.getSiteNodeControllerProxy().acMoveSiteNode(this.getInfoGluePrincipal(), this.siteNodeVO, this.newParentSiteNodeId);
119         
120         return "success";
121     }
122     
123     public String JavaDoc getErrorKey()
124     {
125         return "SiteNode.parentSiteNodeId";
126     }
127     
128     public String JavaDoc getReturnAddress()
129     {
130         return "ViewSiteNode.action?siteNodeId=" + this.siteNodeVO.getId() + "&repositoryId=" + this.repositoryId;
131     }
132
133         
134 }
135
Popular Tags