Element.removeExtension (support for instance-name and instance-description extensions in IG publisher)

This commit is contained in:
Grahame Grieve 2023-10-20 16:26:46 +11:00
parent 20929abc58
commit 2b0d778767
2 changed files with 12 additions and 1 deletions

View File

@ -2546,7 +2546,7 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
} }
} catch (Exception e) { } catch (Exception e) {
// not sure what to do in this case? // not sure what to do in this case?
System.out.println("Unable to generate snapshot @4 for "+p.getVersionedUrl()+": "+e.getMessage()); System.out.println("Unable to generate snapshot @5 for "+p.getVersionedUrl()+": "+e.getMessage());
if (logger.isDebugLogging()) { if (logger.isDebugLogging()) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -1488,4 +1488,15 @@ public class Element extends Base implements NamedItem {
return this; return this;
} }
public void removeExtension(String url) {
List<Element> rem = new ArrayList<>();
for (Element e : children) {
if ("extension".equals(e.getName()) && url.equals(e.getChildValue("url"))) {
rem.add(e);
}
}
children.removeAll(rem);
}
} }