Project

General

Profile

« Previous | Next » 

Revision 4327

remove skin.configs directory.
migrate those properties to the style/skins/* properties files
do not load them during Metacat init.

View differences:

lib/skin.configs/esa/esa.properties
1
lsidauthority=esa.org
2
registryurl=http://data.esa.org/esa
3
registryname=ESA Data Registry
4
cgi-url=http://data.esa.org/cgi-bin
5 0

  
lib/skin.configs/obfs/obfs.properties
1
#lsidauthority=knb.ecoinformatics.org
2
#registryurl=http://knb.ecoinformatics.org/knb
3
#registryname=KNB Data Registry
4 0

  
lib/skin.configs/nceas/nceas.properties
1
#lsidauthority=knb.ecoinformatics.org
2
#registryurl=http://knb.ecoinformatics.org/knb
3
#registryname=KNB Data Registry
4 0

  
lib/skin.configs/knb/knb.properties
1
#lsidauthority=knb.ecoinformatics.org
2
#registryurl=http://knb.ecoinformatics.org/knb
3
#registryname=KNB Data Registry
4 0

  
lib/skin.configs/sanparks/sanparks.properties
1
#lsidauthority=knb.ecoinformatics.org
2
#registryurl=http://knb.ecoinformatics.org/knb
3
#registryname=KNB Data Registry
4
cgi-url=http://dataknp.sanparks.org/cgi-bin
5 0

  
lib/skin.configs/nrs/nrs.properties
1
#idauthority=knb.ecoinformatics.org
2
#registryurl=http://knb.ecoinformatics.org/knb
3
#registryname=KNB Data Registry
4 0

  
lib/skin.configs/default/default.properties
1
cgi-url=/cgi-bin
2 0

  
lib/style/skins/sanparks/sanparks.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/sanparks/sanparks.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
lib/style/skins/default/default.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/default/default.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
lib/style/skins/nceas/nceas.properties
53 53

  
54 54
# imported properties from lib/skin.configs/nceas/nceas.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
lib/style/skins/obfs/obfs.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/obfs/obfs.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
59 59

  
60 60
registry.spatial.Toolik=(AK) Toolik Field Station|68:38:0:N|149:43:0:W
61 61
registry.spatial.Ouachita=(AR) Ouachita Mountains Biological Station|34:26:56.4:N|94:0:32.4:W
lib/style/skins/nrs/nrs.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/nrs/nrs.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
59 59

  
60 60
registry.spatial.Angelo=Angelo Coast Range Reserve|123:38:40:W|39:43:45:N
61 61
registry.spatial.Ano=Ano Nuevo Island Reserve|122:20:10:W|37:6:30:N
lib/style/skins/esa/esa.properties.metadata.xml
128 128
		<description>Determine if contact email address must be entered.</description>
129 129
		<helpFile>properties.html#registry.required.contactEmailAddress</helpFile>
130 130
	</config>
131
	
132
	<!-- LSID support options -->	
133
	<config>
134
		<key>lsidauthority</key>
135
		<label>LSID Authority</label>
136
		<group>1</group>
137
		<index>13</index>
138
		<description>The Authority for LSIDs in this skin</description>
139
		<helpFile>properties.html#lsidauthority</helpFile>
140
	</config>
141
	<config>
142
		<key>registryurl</key>
143
		<label>Registry URL</label>
144
		<group>1</group>
145
		<index>14</index>
146
		<description>The server where this LSID can be located</description>
147
		<helpFile>properties.html#registryurl</helpFile>
148
	</config>
149
	<config>
150
		<key>registryname</key>
151
		<label>Registry Name</label>
152
		<group>1</group>
153
		<index>15</index>
154
		<description>The name of the LSID server</description>
155
		<helpFile>properties.html#registryname</helpFile>
156
	</config>
131 157

  
132 158
</metadataConfig>
lib/style/skins/esa/esa.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/esa/esa.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=esa.org
57
registryurl=http://data.esa.org/esa
58
registryname=ESA Data Registry
59 59

  
60 60
moderators=cn=knb-prod,o=NCEAS,dc=ecoinformatics,dc=org
lib/style/skins/knb/knb.properties
51 51
registry.db.user=
52 52
registry.db.password=
53 53

  
54
# imported properties from lib/skin.configs/nceas/nceas.properties
54
# imported properties from lib/skin.configs/knb/knb.properties
55 55
# java code usage
56
lsidauthority=knb.ecoinformatics.org
57
registryurl=http://knb.ecoinformatics.org
58
registryname=KNB Data Registry
56
lsidauthority=
57
registryurl=
58
registryname=
src/edu/ucsb/nceas/metacat/MetaCatServlet.java
46 46
import java.util.Enumeration;
47 47
import java.util.Hashtable;
48 48
import java.util.Iterator;
49
import java.util.Properties;
50 49
import java.util.Timer;
51 50
import java.util.Vector;
52 51
import java.util.zip.ZipEntry;
......
56 55
import javax.servlet.ServletContext;
57 56
import javax.servlet.ServletException;
58 57
import javax.servlet.ServletOutputStream;
59
import javax.servlet.http.Cookie;
60 58
import javax.servlet.http.HttpServlet;
61 59
import javax.servlet.http.HttpServletRequest;
62 60
import javax.servlet.http.HttpServletResponse;
......
255 253
				timer = new Timer();
256 254
				timer.schedule(new IndexingTimerTask(), delayTime, indexingTimerTaskTime);
257 255
			}
258

  
259
			// read the config files:
260
			Vector<String> skins = MetaCatUtil.getOptionList(PropertyService
261
					.getProperty("skin.names"));
262
			String skinName, skinDirPath = null;
263
			File skinPropertyFile = null;
264

  
265
			for (int i = 0; i < skins.size(); i++) {
266
				skinName = (String) skins.elementAt(i);
267
				skinDirPath = context.getRealPath(CONFIG_DIR + "/skin.configs/"
268
						+ skinName);
269
				skinPropertyFile = new File(skinDirPath, skinName + ".properties");
270
				Properties skinOption = null;
271
				try {
272
					skinOption = new Properties();
273
					FileInputStream fis = new FileInputStream(skinPropertyFile);
274
					skinOption.load(fis);
275
					fis.close();
276
				} catch (IOException ioe) {
277
					logMetacat.error("Error in loading properties for skin " + "skinName"
278
							+ " : " + ioe.getMessage());
279
				}
280
				MetaCatUtil.addSkinConfig(skinName, skinOption);
281
				// MetaCatUtil.skinconfigs.put(skinName, skinOption);
282
			}
283

  
256
			
284 257
			/*
285 258
			 * If spatial option is turned on and set to regenerate the spatial
286 259
			 * cache on restart, trigger the harvester regeneratation method
src/edu/ucsb/nceas/metacat/util/MetaCatUtil.java
61 61

  
62 62
    public static Vector pathsForIndexing;
63 63
    
64
    private static HashMap skinconfigs = new HashMap();
65

  
66 64
    private static boolean debug = true;
67 65
    
68 66
    private static boolean debugErrorDisplayed = false;
......
948 946
        return new File(dirname);
949 947
    }
950 948

  
951
    // TODO MCD remove skins config stuff from here and move into PropertyService
952
    
953
    /**
954
     * Adds the Properties and skin to the list of skin configurations.
955
     * @param skinName String qformat
956
     * @param skinProperties Properties instance
957
     */
958
    public static void addSkinConfig(String skinName, Properties skinProperties) {
959
        skinconfigs.put(skinName, skinProperties);
960
    }
961

  
962
    /**
963
     * Return the Properties for a given skin name.
964
     * @param skinName String qformat
965
     * @return Properties, or null if none exist for the skin.
966
     */
967
    public static Properties getSkinConfig(String skinName) {
968
        Properties                      result;
969
        
970
        result = (Properties) skinconfigs.get(skinName);
971
        return(result);
972
    }
973
    
974
    /**
975
     * Returns true if Properties exist for a given skin name, false otherwise.
976
     * @param skinName String qformat
977
     * @return boolean
978
     */
979
    public static boolean hasSkinConfig(String skinName) {
980
        boolean                     result;
981
        
982
        result = skinconfigs.containsKey(skinName);
983
        return(result);
984
    }
985

  
986 949
	/**
987 950
	 * Reports whether metacat is fully configured.
988 951
	 * 
src/edu/ucsb/nceas/metacat/DBTransform.java
72 72
import org.xml.sax.SAXException;
73 73

  
74 74
import edu.ucsb.nceas.metacat.service.PropertyService;
75
import edu.ucsb.nceas.metacat.service.SkinPropertyService;
75 76
import edu.ucsb.nceas.metacat.util.MetaCatUtil;
76 77
import edu.ucsb.nceas.metacat.util.SystemUtil;
77 78
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
79
import edu.ucsb.nceas.utilities.SortedProperties;
78 80

  
79 81
import java.util.Properties;
80 82

  
......
277 279
          String sessionid) 
278 280
          throws Exception {
279 281
      
280
      Properties skinOptions;
282
      SortedProperties skinOptions;
281 283
      TransformerFactory tFactory;
282 284
      Transformer transformer;
283 285
      String key, value;
......
293 295
        transformer.setParameter("qformat", qformat);
294 296
        logMetacat.warn("qformat: "+qformat);
295 297
        
296
        if (MetaCatUtil.hasSkinConfig(qformat)) {
297
            skinOptions = MetaCatUtil.getSkinConfig(qformat);
298
		
299
            iterIt = skinOptions.entrySet().iterator();
298
        skinOptions = SkinPropertyService.getProperties(qformat);
299
        if (skinOptions != null) {            
300
            iterIt = skinOptions.getProperties().entrySet().iterator();
300 301
            while (iterIt.hasNext()) {
301 302
                entry = (Entry) iterIt.next();
302 303
                key = (String) entry.getKey();
303 304
                value = (String) entry.getValue();
304
                transformer.setParameter(key, value);
305
                //only include the plain properties
306
                if (key.indexOf('.') == -1) {
307
                	transformer.setParameter(key, value);
308
                }
305 309
            }
306 310
        }
307 311
        

Also available in: Unified diff