]>
git.argeo.org Git - gpl/argeo-suite.git/blob - DbkAcrUtils.java
fed027d7477c904ebd81c9107b2ddfbf4e769770
1 package org
.argeo
.app
.docbook
;
3 import org
.argeo
.api
.acr
.Content
;
4 import org
.argeo
.api
.app
.EntityType
;
6 /** Utilities when using ACR to access DocBook. */
7 public class DbkAcrUtils
{
8 /** Whether this DocBook element is of this type. */
9 public static boolean isDbk(Content content
, DbkType type
) {
10 return content
.isContentClass(type
.qName());
13 public static String
getMediaFileref(Content node
) {
15 if (node
.hasChild(DbkType
.imageobject
)) {
16 mediadata
= node
.child(DbkType
.imageobject
).child(DbkType
.imagedata
);
18 mediadata
= node
.child(DbkType
.videoobject
).child(DbkType
.videodata
);
21 if (mediadata
.containsKey(DbkAttr
.fileref
)) {
22 return mediadata
.attr(DbkAttr
.fileref
);
28 public static Content
getMetadata(Content infoContainer
) {
29 if (!infoContainer
.hasChild(DbkType
.info
))
31 Content info
= infoContainer
.child(DbkType
.info
);
32 if (!info
.hasChild(EntityType
.local
))
34 return info
.child(EntityType
.local
);
38 private DbkAcrUtils() {