KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > applications > managementtool > actions > UpdateSiteNodeTypeDefinitionAction


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.managementtool.actions;
25
26 import org.infoglue.cms.controllers.kernel.impl.simple.SiteNodeTypeDefinitionController;
27 import org.infoglue.cms.entities.management.SiteNodeTypeDefinitionVO;
28 import org.infoglue.cms.exception.ConstraintException;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31
32 /**
33   * This is the action-class for UpdateSiteNodeTypeDefinition
34   *
35   * @author Mattias Bogeblad
36   */

37 public class UpdateSiteNodeTypeDefinitionAction extends ViewSiteNodeTypeDefinitionAction //WebworkAbstractAction
38
{
39     
40     private SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO;
41     private Integer JavaDoc siteNodeTypeDefinitionId;
42     private String JavaDoc name;
43     private String JavaDoc description;
44     private String JavaDoc invokerClassName;
45     private ConstraintExceptionBuffer ceb;
46     
47     public UpdateSiteNodeTypeDefinitionAction()
48     {
49         this(new SiteNodeTypeDefinitionVO());
50     }
51     
52     public UpdateSiteNodeTypeDefinitionAction(SiteNodeTypeDefinitionVO siteNodeTypeDefinitionVO)
53     {
54         this.siteNodeTypeDefinitionVO = siteNodeTypeDefinitionVO;
55         this.ceb = new ConstraintExceptionBuffer();
56     }
57     
58     public String JavaDoc doExecute() throws Exception JavaDoc
59     {
60         super.initialize(getSiteNodeTypeDefinitionId());
61
62         ceb.add(this.siteNodeTypeDefinitionVO.validate());
63         ceb.throwIfNotEmpty();
64         
65         String JavaDoc[] values = getRequest().getParameterValues("availableServiceBindingId");
66         
67         SiteNodeTypeDefinitionController.getController().update(this.siteNodeTypeDefinitionVO, values);
68         
69         return "success";
70     }
71
72     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
73     {
74         doExecute();
75                         
76         return "saveAndExit";
77     }
78
79     public void setSiteNodeTypeDefinitionId(Integer JavaDoc siteNodeTypeDefinitionId)
80     {
81         this.siteNodeTypeDefinitionVO.setSiteNodeTypeDefinitionId(siteNodeTypeDefinitionId);
82     }
83
84     public java.lang.Integer JavaDoc getSiteNodeTypeDefinitionId()
85     {
86         return this.siteNodeTypeDefinitionVO.getSiteNodeTypeDefinitionId();
87     }
88         
89     public java.lang.String JavaDoc getName()
90     {
91         if(this.name != null)
92             return this.name;
93     
94         return this.siteNodeTypeDefinitionVO.getName();
95     }
96         
97     public void setName(java.lang.String JavaDoc name)
98     {
99         try
100         {
101             this.siteNodeTypeDefinitionVO.setName(name);
102         }
103         catch(ConstraintException ce)
104         {
105             this.name = name;
106             this.ceb.add(new ConstraintExceptionBuffer(ce));
107         }
108     }
109
110     public String JavaDoc getDescription()
111     {
112         if(this.description != null)
113             return this.description;
114             
115         return this.siteNodeTypeDefinitionVO.getDescription();
116     }
117         
118     public void setDescription(String JavaDoc description)
119     {
120         try
121         {
122             this.siteNodeTypeDefinitionVO.setDescription(description);
123         }
124         catch(ConstraintException ce)
125         {
126             this.description = description;
127             this.ceb.add(new ConstraintExceptionBuffer(ce));
128         }
129     }
130     
131     public String JavaDoc getInvokerClassName()
132     {
133         if(this.invokerClassName != null)
134             return this.invokerClassName;
135             
136         return this.siteNodeTypeDefinitionVO.getInvokerClassName();
137     }
138         
139     public void setInvokerClassName(String JavaDoc invokerClassName)
140     {
141         try
142         {
143             this.siteNodeTypeDefinitionVO.setInvokerClassName(invokerClassName);
144         }
145         catch(ConstraintException ce)
146         {
147             this.invokerClassName = invokerClassName;
148             this.ceb.add(new ConstraintExceptionBuffer(ce));
149         }
150     }
151 }
152
Popular Tags