KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.List JavaDoc;
27
28 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
29 import org.infoglue.cms.controllers.kernel.impl.simple.LanguageController;
30 import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryController;
31 import org.infoglue.cms.controllers.kernel.impl.simple.RepositoryLanguageController;
32 import org.infoglue.cms.entities.management.LanguageVO;
33 import org.infoglue.cms.entities.management.RepositoryVO;
34
35 /**
36  * This class implements the action class for viewRepository.
37  * The use-case lets the user see all information about a specific site/repository.
38  *
39  * @author Mattias Bogeblad
40  */

41
42 public class ViewRepositoryAction extends InfoGlueAbstractAction
43 {
44     private static final long serialVersionUID = 1L;
45
46     private RepositoryVO repositoryVO;
47
48     private List JavaDoc repositoryLanguageVOList;
49     private List JavaDoc allRemainingLanguageVOList;
50
51     //private List availableLanguageVOList;
52
//private List languageVOList;
53

54     public ViewRepositoryAction()
55     {
56         this(new RepositoryVO());
57     }
58     
59     public ViewRepositoryAction(RepositoryVO repositoryVO)
60     {
61         this.repositoryVO = repositoryVO;
62     }
63     
64     protected void initialize(Integer JavaDoc repositoryId) throws Exception JavaDoc
65     {
66         repositoryVO = RepositoryController.getController().getRepositoryVOWithId(repositoryId);
67         
68         this.repositoryLanguageVOList = RepositoryLanguageController.getController().getRepositoryLanguageVOListWithRepositoryId(repositoryId);
69         this.allRemainingLanguageVOList = RepositoryLanguageController.getController().getRemainingLanguages(repositoryId);
70         
71         //availableLanguageVOList = LanguageController.getController().getLanguageVOList(repositoryId);
72
//languageVOList = LanguageController.getController().getLanguageVOList();
73
}
74
75     /**
76      * The main method that fetches the Value-object for this use-case
77      */

78     
79     public String JavaDoc doExecute() throws Exception JavaDoc
80     {
81         this.initialize(getRepositoryId());
82
83         return "success";
84     }
85
86     /**
87      * The main method that fetches the Value-object for this use-case
88      */

89     
90     public String JavaDoc doLocalView() throws Exception JavaDoc
91     {
92         this.initialize(getRepositoryId());
93
94         return "successLocal";
95     }
96           
97     public java.lang.Integer JavaDoc getRepositoryId()
98     {
99         return this.repositoryVO.getRepositoryId();
100     }
101         
102     public void setRepositoryId(java.lang.Integer JavaDoc repositoryId) throws Exception JavaDoc
103     {
104         this.repositoryVO.setRepositoryId(repositoryId);
105     }
106
107     public java.lang.String JavaDoc getName()
108     {
109         return this.repositoryVO.getName();
110     }
111
112     public java.lang.String JavaDoc getDescription()
113     {
114         return this.repositoryVO.getDescription();
115     }
116
117     public java.lang.String JavaDoc getDnsName()
118     {
119         return this.repositoryVO.getDnsName();
120     }
121     
122     /*
123     public List getAvailableLanguages()
124     {
125         return this.availableLanguageVOList;
126     }
127
128     public List getAllLanguages()
129     {
130         return this.languageVOList;
131     }
132     */

133     
134     /*
135     public List getRoles()throws Exception{
136         return (List) RepositoryController.getRepositoryRoleVOList(this.getRepositoryId());
137     }
138     */

139     public List JavaDoc getAllRemainingLanguageVOList()
140     {
141         return allRemainingLanguageVOList;
142     }
143     
144     public List JavaDoc getRepositoryLanguageVOList()
145     {
146         return repositoryLanguageVOList;
147     }
148     
149     public LanguageVO getLanguage(Integer JavaDoc repositoryLanguageId) throws Exception JavaDoc
150     {
151         return LanguageController.getController().getLanguageVOWithRepositoryLanguageId(repositoryLanguageId);
152     }
153
154 }
155
Popular Tags