Project

General

Profile

« Previous | Next » 

Revision 2896

Added by sgarg almost 19 years ago

Using java.util.Property instead of Options. Options is a singleton class. Hence it cant be used for reading skin property files without changing it into a non-singleton class

View differences:

src/edu/ucsb/nceas/metacat/MetaCatServlet.java
45 45
import java.util.HashMap;
46 46
import java.util.Hashtable;
47 47
import java.util.Iterator;
48
import java.util.Properties;
48 49
import java.util.Timer;
49 50
import java.util.Vector;
50 51
import java.util.zip.ZipEntry;
......
188 189
            	skinName = (String) skins.elementAt(i);
189 190
                skinDirPath = context.getRealPath(CONFIG_DIR + "/skin.configs/" + skinName);
190 191
                skinPropertyFile = new File(skinDirPath, skinName + ".config"); 
191
                Options skinOption = null;
192
                Properties skinOption = null;
192 193
                try	{
193
                	skinOption = Options.initialize(skinPropertyFile);
194
                	skinOption = new Properties();
195
                    FileInputStream fis = new FileInputStream(skinPropertyFile);
196
                    skinOption.load(fis);
197
                    fis.close();
194 198
                } catch (IOException ioe) {
195 199
                    Logger logMetacat = Logger.getLogger(MetaCatServlet.class);
196 200
                    logMetacat.error("Error in loading options for skin " + "skinName" +" : "
197 201
                            + ioe.getMessage());
198
                }
199
                
202
                }                
200 203
                MetaCatUtil.skinconfigs.put(skinName, skinOption);
201 204
            }
202 205
            
src/edu/ucsb/nceas/metacat/DBTransform.java
71 71
import org.w3c.dom.Element;
72 72
import org.xml.sax.SAXException;
73 73

  
74
import edu.ucsb.nceas.utilities.Options;
74
import java.util.Properties;
75 75

  
76 76
/**
77 77
 * A Class that transforms XML documents utitlizing XSL style sheets
......
269 269
        logMetacat.warn("qformat: "+qformat);
270 270
        
271 271
        if (MetaCatUtil.skinconfigs.containsKey(qformat)){
272
        	Options skinOptions = (Options)MetaCatUtil.skinconfigs.get(qformat);
273
        	transformer.setParameter("lsidauthority", skinOptions.getOption("lsidauthority"));
274
           	transformer.setParameter("registryurl", skinOptions.getOption("registryurl"));
275
           	transformer.setParameter("registryname", skinOptions.getOption("registryname"));
272
        	Properties skinOptions = (Properties)MetaCatUtil.skinconfigs.get(qformat);
273
        	transformer.setParameter("lsidauthority", skinOptions.getProperty("lsidauthority"));
274
           	transformer.setParameter("registryurl", skinOptions.getProperty("registryurl"));
275
           	transformer.setParameter("registryname", skinOptions.getProperty("registryname"));
276 276
        }
277 277
        
278 278
        if(sessionid != null)

Also available in: Unified diff