+ public void setUrlData(List<UrlLinkDisplay> links)
+ {
+ HashMap<String, UrlLink> newurls = new HashMap<String, UrlLink>();
+
+ Iterator<UrlLinkDisplay> it = links.iterator();
+ while (it.hasNext())
+ {
+ UrlLinkDisplay link = it.next();
+
+ // MIRIAM ids will be handled by a different UrlProvider class
+ if (!isMiriamId(link.getId()))
+ {
+
+ // don't allow duplicate key names as entries will be overwritten
+ if (newurls.containsKey(link.getId()))
+ {
+ throw new IllegalArgumentException(MessageManager.formatMessage(
+ "exception.url_cannot_have_duplicate_id", link.getId()));
+ }
+ if (link.getIsSelected())
+ {
+ newurls.put(link.getId(),
+ new UrlLink(link.getId() + SEP + link.getUrl()));
+
+ // sort out default and selected ids
+ if (link.getIsDefault())
+ {
+ setDefaultUrl(link.getId());
+ }
+ }
+ // TODO KM make it possible to set and save selected custom urls
+
+ }
+
+ }
+ urls = newurls;
+ }
+
+ @Override