KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > server > PresentationEdit


1 package org.enhydra.server;
2
3 import org.enhydra.util.ConfigFileInterface;
4
5 import com.lutris.util.Config;
6 import com.lutris.util.KeywordValueException;
7
8
9 /**
10  * <p>Title: </p>
11  * <p>Description: </p>
12  * <p>Copyright: Copyright (c) 2002</p>
13  * <p>Company: www.together.at</p>
14  * @author tufeX, tufex@uns.ns.ac.yu
15  * @version 1.0
16  */

17
18
19
20 public class PresentationEdit {
21
22   private String JavaDoc cacheClasses;
23   private String JavaDoc cacheFiles;
24
25   private Config orgconfig ;
26   private Config config;
27
28   public PresentationEdit(Config pmConfig) throws KeywordValueException{
29     orgconfig = pmConfig;
30     config = pmConfig;
31     if (config != null) {
32       config = (Config) config.getSection("PresentationManager.");
33       if (config.containsKey("CacheClasses")) cacheClasses = config.getString("CacheClasses");
34       if (config.containsKey("CacheFiles")) cacheFiles = config.getString("CacheFiles");
35       config = orgconfig;
36     }
37
38   }
39
40   public String JavaDoc getCacheClasses() {
41     return cacheClasses;
42   }
43   public void setCacheClasses(String JavaDoc cacheClasses) throws KeywordValueException{
44     this.cacheClasses = cacheClasses;
45     config.set("PresentationManager.CacheClasses",cacheClasses);
46   }
47   public void setCacheFiles(String JavaDoc cacheFiles) throws KeywordValueException{
48     this.cacheFiles = cacheFiles;
49     config.set("PresentationManager.CacheFiles",cacheFiles);
50   }
51   public String JavaDoc getCacheFiles() {
52     return cacheFiles;
53   }
54
55   /**
56    * Save state of DatabaseManager configuration parameters into config file
57    * @return TRUE if OK, else FALSE.
58    */

59
60   public boolean saveState() {
61     try{
62     ConfigFileInterface confFile = orgconfig.getConfigFile();
63     confFile.write();
64    }catch(Exception JavaDoc e){
65       return false;
66     }
67     return true;
68   }
69
70 }
Popular Tags