KickJava   Java API By Example, From Geeks To Geeks.

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


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.RepositoryController;
27 import org.infoglue.cms.entities.management.RepositoryVO;
28 import org.infoglue.cms.util.ConstraintExceptionBuffer;
29
30
31 /**
32   * This is the action-class for UpdateRepository
33   *
34   * @author Mattias Bogeblad
35   */

36 public class UpdateRepositoryAction extends ViewRepositoryAction //WebworkAbstractAction
37
{
38     
39     private RepositoryVO repositoryVO;
40     private Integer JavaDoc repositoryId;
41     private String JavaDoc userAction = "";
42     private ConstraintExceptionBuffer ceb;
43     
44     public UpdateRepositoryAction()
45     {
46         this(new RepositoryVO());
47     }
48     
49     public UpdateRepositoryAction(RepositoryVO repositoryVO)
50     {
51         this.repositoryVO = repositoryVO;
52         this.ceb = new ConstraintExceptionBuffer();
53     }
54
55         
56     public String JavaDoc doExecute() throws Exception JavaDoc
57     {
58         super.initialize(getRepositoryId());
59
60         ceb.add(this.repositoryVO.validate());
61         ceb.throwIfNotEmpty();
62         
63         String JavaDoc[] values = getRequest().getParameterValues("languageId");
64         
65         RepositoryController.getController().update(this.repositoryVO, values);
66                 
67         return "success";
68     }
69
70     public String JavaDoc doLocal() throws Exception JavaDoc
71     {
72         super.initialize(getRepositoryId());
73
74         ceb.throwIfNotEmpty();
75         
76         RepositoryController.getController().update(this.repositoryVO);
77         
78         return "successLocal";
79     }
80
81     public String JavaDoc doSaveAndExit() throws Exception JavaDoc
82     {
83         doExecute();
84                         
85         return "saveAndExit";
86     }
87
88     public String JavaDoc doSaveAndExitLocal() throws Exception JavaDoc
89     {
90         doLocal();
91                         
92         return "saveAndExitLocal";
93     }
94
95     public void setRepositoryId(Integer JavaDoc repositoryId) throws Exception JavaDoc
96     {
97         this.repositoryVO.setRepositoryId(repositoryId);
98     }
99
100     public java.lang.Integer JavaDoc getRepositoryId()
101     {
102         return this.repositoryVO.getRepositoryId();
103     }
104         
105     public java.lang.String JavaDoc getName()
106     {
107         return this.repositoryVO.getName();
108     }
109         
110     public void setName(java.lang.String JavaDoc name)
111     {
112         this.repositoryVO.setName(name);
113     }
114
115     public String JavaDoc getDescription()
116     {
117         return this.repositoryVO.getDescription();
118     }
119         
120     public void setDescription(String JavaDoc description)
121     {
122         this.repositoryVO.setDescription(description);
123     }
124     
125     public String JavaDoc getDnsName()
126     {
127         return this.repositoryVO.getDnsName();
128     }
129         
130     public void setDnsName(String JavaDoc dnsName)
131     {
132         this.repositoryVO.setDnsName(dnsName);
133     }
134     
135 }
136
Popular Tags