X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.app.core%2Fsrc%2Forg%2Fargeo%2Fapp%2Fdocbook%2FDbkAcrUtils.java;h=fed027d7477c904ebd81c9107b2ddfbf4e769770;hb=HEAD;hp=8dda2b49dfb6e4d689c5fcf1abb2bd169ebfde30;hpb=cc03074c27d48af9e5842272c18f8c418a25d3e6;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java b/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java index 8dda2b4..fed027d 100644 --- a/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java +++ b/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java @@ -1,7 +1,9 @@ package org.argeo.app.docbook; import org.argeo.api.acr.Content; +import org.argeo.api.app.EntityType; +/** Utilities when using ACR to access DocBook. */ public class DbkAcrUtils { /** Whether this DocBook element is of this type. */ public static boolean isDbk(Content content, DbkType type) { @@ -23,6 +25,15 @@ public class DbkAcrUtils { } } + public static Content getMetadata(Content infoContainer) { + if (!infoContainer.hasChild(DbkType.info)) + return null; + Content info = infoContainer.child(DbkType.info); + if (!info.hasChild(EntityType.local)) + return null; + return info.child(EntityType.local); + } + /** singleton */ private DbkAcrUtils() { }