KickJava   Java API By Example, From Geeks To Geeks.

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


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.applications.common.actions.InfoGlueAbstractAction;
27 import org.infoglue.cms.controllers.kernel.impl.simple.UserPropertiesController;
28 import org.infoglue.cms.entities.management.UserPropertiesVO;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31 /**
32   * This is the action-class for UpdateUserPropertiesAction
33   *
34   * @author Mattias Bogeblad
35   */

36
37 public class UpdateUserPropertiesAction extends InfoGlueAbstractAction
38 {
39     private UserPropertiesVO userPropertiesVO;
40     private Integer JavaDoc languageId;
41     private Integer JavaDoc contentTypeDefinitionId;
42     private Integer JavaDoc currentEditorId;
43     private String JavaDoc attributeName;
44     private String JavaDoc returnAddress;
45
46     private ConstraintExceptionBuffer ceb;
47     
48     public UpdateUserPropertiesAction()
49     {
50         userPropertiesVO = new UserPropertiesVO();
51         this.ceb = new ConstraintExceptionBuffer();
52     }
53         
54     public String JavaDoc doExecute() throws Exception JavaDoc
55     {
56         //super.initialize(this.contentVersionId, this.contentId, this.languageId);
57
ceb.throwIfNotEmpty();
58         UserPropertiesController.getController().update(this.languageId, this.contentTypeDefinitionId, this.userPropertiesVO);
59         
60         this.getResponse().sendRedirect(returnAddress);
61         
62         return NONE;
63     }
64
65     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
66     {
67         UserPropertiesController.getController().update(this.languageId, this.contentTypeDefinitionId, this.userPropertiesVO);
68                          
69         return "saveAndExit";
70     }
71
72     public String JavaDoc doSaveAndExitStandalone() throws Exception JavaDoc
73     {
74         UserPropertiesController.getController().update(this.languageId, this.contentTypeDefinitionId, this.userPropertiesVO);
75                          
76         return "saveAndExitStandalone";
77     }
78
79     public void setEntityId(Integer JavaDoc userPropertiesId)
80     {
81         this.userPropertiesVO.setUserPropertiesId(userPropertiesId);
82     }
83
84     public java.lang.Integer JavaDoc getEntityId()
85     {
86         return this.userPropertiesVO.getUserPropertiesId();
87     }
88     
89     public Integer JavaDoc getContentTypeDefinitionId()
90     {
91         return contentTypeDefinitionId;
92     }
93
94     public void setContentTypeDefinitionId(Integer JavaDoc contentTypeDefinitionId)
95     {
96         this.contentTypeDefinitionId = contentTypeDefinitionId;
97     }
98
99     public String JavaDoc getUserName()
100     {
101         return this.userPropertiesVO.getUserName();
102     }
103
104     public void setUserName(String JavaDoc userName)
105     {
106         this.userPropertiesVO.setUserName(userName);
107     }
108
109     public String JavaDoc getOwnerEntityId()
110     {
111         return this.userPropertiesVO.getUserName();
112     }
113
114     public void setOwnerEntityId(String JavaDoc ownerEntityId)
115     {
116         this.userPropertiesVO.setUserName(ownerEntityId);
117     }
118
119     public void setLanguageId(Integer JavaDoc languageId)
120     {
121         this.languageId = languageId;
122     }
123
124     public java.lang.Integer JavaDoc getLanguageId()
125     {
126         return this.languageId;
127     }
128         
129     public java.lang.String JavaDoc getValue()
130     {
131         return this.userPropertiesVO.getValue();
132     }
133         
134     public void setValue(java.lang.String JavaDoc value)
135     {
136         this.userPropertiesVO.setValue(value);
137     }
138     
139     public Integer JavaDoc getCurrentEditorId()
140     {
141         return currentEditorId;
142     }
143
144     public void setCurrentEditorId(Integer JavaDoc integer)
145     {
146         currentEditorId = integer;
147     }
148
149     public String JavaDoc getAttributeName()
150     {
151         return this.attributeName;
152     }
153
154     public void setAttributeName(String JavaDoc attributeName)
155     {
156         this.attributeName = attributeName;
157     }
158
159     public String JavaDoc getReturnAddress()
160     {
161         return returnAddress;
162     }
163     
164     public void setReturnAddress(String JavaDoc returnAddress)
165     {
166         this.returnAddress = returnAddress;
167     }
168
169 }
170
Popular Tags