Improve DocBook ACR support
[gpl/argeo-suite.git] / org.argeo.app.core / src / org / argeo / app / docbook / DbkAcrUtils.java
index 8dda2b49dfb6e4d689c5fcf1abb2bd169ebfde30..8a92db379ec76ee4fb77b6bce3fe6809f7f2d983 100644 (file)
@@ -1,7 +1,9 @@
 package org.argeo.app.docbook;
 
 import org.argeo.api.acr.Content;
+import org.argeo.app.api.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() {
        }