|
Lines 40-45
Link Here
|
| 40 |
private String type; |
40 |
private String type; |
| 41 |
private URLEntry[] associateSites; |
41 |
private URLEntry[] associateSites; |
| 42 |
private String digestURLString; |
42 |
private String digestURLString; |
|
|
43 |
private List messageKeys; |
| 44 |
private Map localizations; |
| 43 |
|
45 |
|
| 44 |
/** |
46 |
/** |
| 45 |
* Creates an uninitialized site model object. |
47 |
* Creates an uninitialized site model object. |
|
Lines 72-79
Link Here
|
| 72 |
public void addCategory(SiteCategory category) { |
74 |
public void addCategory(SiteCategory category) { |
| 73 |
if (categories == null) |
75 |
if (categories == null) |
| 74 |
categories = new HashMap(); |
76 |
categories = new HashMap(); |
| 75 |
if (!categories.containsKey(category.getName())) |
77 |
if (!categories.containsKey(category.getName())) { |
| 76 |
categories.put(category.getName(), category); |
78 |
categories.put(category.getName(), category); |
|
|
79 |
if (localizations != null && !localizations.isEmpty()) |
| 80 |
category.setLocalizations(localizations); |
| 81 |
} |
| 77 |
} |
82 |
} |
| 78 |
|
83 |
|
| 79 |
/** |
84 |
/** |
|
Lines 167-172
Link Here
|
| 167 |
} |
172 |
} |
| 168 |
|
173 |
|
| 169 |
/** |
174 |
/** |
|
|
175 |
* Gets the localizations for the site as a map from locale |
| 176 |
* to the set of translated properties for that locale. |
| 177 |
* |
| 178 |
* @return a map from locale to property set |
| 179 |
* @since 3.4 |
| 180 |
*/ |
| 181 |
public Map getLocalizations() { |
| 182 |
return this.localizations; |
| 183 |
} |
| 184 |
|
| 185 |
/** |
| 170 |
* Returns the resolved URL for the site. |
186 |
* Returns the resolved URL for the site. |
| 171 |
* |
187 |
* |
| 172 |
* @return url, or <code>null</code> |
188 |
* @return url, or <code>null</code> |
|
Lines 192-197
Link Here
|
| 192 |
} |
208 |
} |
| 193 |
|
209 |
|
| 194 |
/** |
210 |
/** |
|
|
211 |
* Return the keys for translatable strings |
| 212 |
* |
| 213 |
* @return the list of keys for translatable strings; may be null |
| 214 |
* @since 3.4 |
| 215 |
*/ |
| 216 |
public List getMessageKeys() { |
| 217 |
return messageKeys; |
| 218 |
} |
| 219 |
|
| 220 |
/** |
| 195 |
* Return an array of update site mirrors |
221 |
* Return an array of update site mirrors |
| 196 |
* |
222 |
* |
| 197 |
* @return an array of mirror entries, or an empty array. |
223 |
* @return an array of mirror entries, or an empty array. |
|
Lines 278-283
Link Here
|
| 278 |
} |
304 |
} |
| 279 |
|
305 |
|
| 280 |
/** |
306 |
/** |
|
|
307 |
* Sets the localizations for the site as a map from locale |
| 308 |
* to the set of translated properties for that locale. |
| 309 |
* |
| 310 |
* @param localizations as a map from locale to property set |
| 311 |
* @since 3.4 |
| 312 |
*/ |
| 313 |
public void setLocalizations(Map localizations) { |
| 314 |
this.localizations = localizations; |
| 315 |
if (localizations != null && !localizations.isEmpty() && // |
| 316 |
categories != null && !categories.isEmpty()) { |
| 317 |
for (Iterator catIter = categories.entrySet().iterator(); catIter.hasNext();) { |
| 318 |
Map.Entry entry = (Map.Entry) catIter.next(); |
| 319 |
SiteCategory category = (SiteCategory) entry.getValue(); |
| 320 |
category.setLocalizations(localizations); |
| 321 |
} |
| 322 |
} |
| 323 |
} |
| 324 |
|
| 325 |
/** |
| 281 |
* Sets the unresolved URL for the site. |
326 |
* Sets the unresolved URL for the site. |
| 282 |
* |
327 |
* |
| 283 |
* @param locationURLString url for the site (as a string) |
328 |
* @param locationURLString url for the site (as a string) |
|
Lines 288-293
Link Here
|
| 288 |
} |
333 |
} |
| 289 |
|
334 |
|
| 290 |
/** |
335 |
/** |
|
|
336 |
* Sets keys for translatable strings |
| 337 |
* |
| 338 |
* @param keys for translatable strings |
| 339 |
* @since 3.4 |
| 340 |
*/ |
| 341 |
public void setMessageKeys(List keys) { |
| 342 |
this.messageKeys = keys; |
| 343 |
} |
| 344 |
|
| 345 |
/** |
| 291 |
* Sets additional mirror sites |
346 |
* Sets additional mirror sites |
| 292 |
* |
347 |
* |
| 293 |
* @param mirrors additional update site mirrors |
348 |
* @param mirrors additional update site mirrors |