KickJava   Java API By Example, From Geeks To Geeks.

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


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 UpdateMySettingsAction extends InfoGlueAbstractAction
42 {
43     private PropertySet propertySet = null;
44     
45     private String JavaDoc languageCode = null;
46     private String JavaDoc defaultToolId = null;
47
48         
49     /**
50      * The main method that fetches the Value-objects for this use-case
51      */

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

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

89
90
91     public void setLanguageCode(String JavaDoc languageCode)
92     {
93         this.languageCode = languageCode;
94     }
95     
96     public void setDefaultToolId(String JavaDoc defaultToolId)
97     {
98         this.defaultToolId = defaultToolId;
99     }
100 }
101
Popular Tags