KickJava   Java API By Example, From Geeks To Geeks.

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


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.HashMap JavaDoc;
27 import java.util.Map JavaDoc;
28
29 import org.infoglue.cms.applications.common.actions.InfoGlueAbstractAction;
30
31 import com.opensymphony.module.propertyset.PropertySet;
32 import com.opensymphony.module.propertyset.PropertySetManager;
33
34 /**
35  * This class implements the action class for viewRepositoryProperties.
36  * The use-case lets the user see all extra-properties for a repository
37  *
38  * @author Mattias Bogeblad
39  */

40
41 public class ViewMySettingsAction extends InfoGlueAbstractAction
42 {
43     private static final long serialVersionUID = 1L;
44
45     private PropertySet propertySet = null;
46     
47     private String JavaDoc languageCode = null;
48     private String JavaDoc defaultToolId = null;
49         
50     /**
51      * The main method that fetches the Value-objects for this use-case
52      */

53     
54     public String JavaDoc doExecute() throws Exception JavaDoc
55     {
56         Map JavaDoc args = new HashMap JavaDoc();
57         args.put("globalKey", "infoglue");
58         PropertySet ps = PropertySetManager.getInstance("jdbc", args);
59         
60         this.languageCode = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_languageCode");
61         this.defaultToolId = ps.getString("principal_" + this.getInfoGluePrincipal().getName() + "_defaultToolId");
62
63         return "success";
64     }
65     
66    
67     
68     /**
69      * The main method that fetches the Value-objects for this use-case
70      */

71     /*
72     public String doSave() throws Exception
73     {
74         Map args = new HashMap();
75         args.put("globalKey", "infoglue");
76         PropertySet ps = PropertySetManager.getInstance("jdbc", args);
77         
78         ps.setData("repository_" + this.getRepositoryId() + "_WYSIWYGConfig", WYSIWYGConfig.getBytes("utf-8"));
79         ps.setData("repository_" + this.getRepositoryId() + "_StylesXML", stylesXML.getBytes("utf-8"));
80         ps.setString("repository_" + this.getRepositoryId() + "_defaultFolderContentTypeName", defaultFolderContentTypeName);
81         ps.setString("repository_" + this.getRepositoryId() + "_defaultTemplateRepository", defaultTemplateRepository);
82         ps.setString("repository_" + this.getRepositoryId() + "_parentRepository", parentRepository);
83         
84         //TODO - hack to get the caches to be updated when properties are affected..
85         RepositoryVO repositoryVO = RepositoryController.getController().getFirstRepositoryVO();
86         repositoryVO.setDescription(repositoryVO.getDescription() + ".");
87         RepositoryController.getController().update(repositoryVO);
88         
89         return "save";
90     }
91     */

92
93
94     public String JavaDoc getLanguageCode()
95     {
96         return languageCode;
97     }
98     
99     public String JavaDoc getDefaultToolId()
100     {
101         return defaultToolId;
102     }
103 }
104
Popular Tags