KickJava   Java API By Example, From Geeks To Geeks.

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


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.RepositoryController;
28 import org.infoglue.cms.entities.management.RepositoryVO;
29 import org.infoglue.cms.util.ConstraintExceptionBuffer;
30
31 public class CreateRepositoryAction extends InfoGlueAbstractAction
32 {
33     private RepositoryVO repositoryVO;
34     private ConstraintExceptionBuffer ceb;
35
36     
37     public CreateRepositoryAction()
38     {
39         this(new RepositoryVO());
40     }
41     
42     public CreateRepositoryAction(RepositoryVO repositoryVO)
43     {
44         this.repositoryVO = repositoryVO;
45         this.ceb = new ConstraintExceptionBuffer();
46             
47     }
48     public Integer JavaDoc getRepositoryId()
49     {
50         return this.repositoryVO.getId();
51     }
52     
53     public java.lang.String JavaDoc getName()
54     {
55         return this.repositoryVO.getName();
56     }
57         
58     public void setName(java.lang.String JavaDoc name)
59     {
60         this.repositoryVO.setName(name);
61     }
62       
63     public String JavaDoc getDescription()
64     {
65         return this.repositoryVO.getDescription();
66     }
67         
68     public void setDescription(String JavaDoc description)
69     {
70         this.repositoryVO.setDescription(description);
71     }
72
73     public String JavaDoc getDnsName()
74     {
75         return this.repositoryVO.getDnsName();
76     }
77         
78     public void setDnsName(String JavaDoc dnsName)
79     {
80         this.repositoryVO.setDnsName(dnsName);
81     }
82
83
84     public String JavaDoc doExecute() throws Exception JavaDoc
85     {
86         ceb.add(this.repositoryVO.validate());
87         ceb.throwIfNotEmpty();
88         
89         this.repositoryVO = RepositoryController.getController().create(repositoryVO);
90         
91         return "success";
92     }
93         
94     public String JavaDoc doInput() throws Exception JavaDoc
95     {
96         return "input";
97     }
98 }
99
Popular Tags