Project

General

Profile

« Previous | Next » 

Revision 4762

Added by daigle about 15 years ago

Only configure skins that are correctly configured in the skins directory.

View differences:

SkinsAdmin.java
100 100
					PropertyService.getProperty("application.default-style");
101 101

  
102 102
				request.setAttribute("defaultStyle", defaultStyle);
103
				request.setAttribute("skinNameList", skinNames);
104 103
				
105 104
				// add skin metadata to the request.  The configuration form
106 105
				// will use this data to determine what the configuration 
......
117 116
					new HashMap<String, HashMap<String, String>>();
118 117
				HashMap<String, SortedProperties> backupPropertiesMap = 
119 118
					SkinPropertyService.getBackupProperties();
119
				
120
				// Just in case a skin is not configured correctly, we will want to remove 
121
				// it from the skins list
122
				Vector<String> removeSkins = new Vector<String>();
120 123
					
121 124
				for (String skinName : skinNames) {
122 125
					// first, get a deep copy of this skin's properties
123 126

  
124 127
					SortedProperties skinProperties = originalPropertyMap.get(skinName);
125 128
					if (skinProperties == null) {
126
						throw new GeneralPropertyException("Could not find properties " 
127
								+ "for skin: " + skinName);
129
						logMetacat.error("Could not find properties for skin: " + skinName);
130
						removeSkins.add(skinName);
131
						continue;
128 132
					}
129 133

  
130 134
					HashMap<String, String> originalSkinProperties = 
......
147 151
					}
148 152
								
149 153
					localPropertyMap.put(skinName, localSkinProperties);					
150
				}				
154
				}	
155
				
156
				// If there are any skins for which we could not get properties, remove them from 
157
				// the skins list we will send to the configuration page.
158
				for (String skinName : removeSkins) {
159
					skinNames.remove(skinName);
160
				}
161
				
162
				request.setAttribute("skinNameList", skinNames);
151 163
				request.setAttribute("skinProperties", localPropertyMap);
152 164
				
153 165
				// Forward the request to the JSP page
......
182 194
				for (String skinName : skinNames) {
183 195
					PropertiesMetaData skinMetaData = 
184 196
						SkinPropertyService.getMetaData(skinName);
197
					
198
					if (skinMetaData == null) {
199
						logMetacat.error("Could not find metadata for skin: " + skinName);
200
						continue;
201
					}
202
					
185 203
					Set<String> metaDataKeySet = skinMetaData.getKeys();
186 204
					for (String metaDataKey : metaDataKeySet) {
187 205
						MetaDataProperty metaDataProperty = 

Also available in: Unified diff