]> git.argeo.org Git - gpl/argeo-suite.git/blob - org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java
Only external userAdmin can set userAdmin
[gpl/argeo-suite.git] / org.argeo.app.core / src / org / argeo / app / docbook / DbkAcrUtils.java
1 package org.argeo.app.docbook;
2
3 import org.argeo.api.acr.Content;
4
5 public class DbkAcrUtils {
6 /** Whether this DocBook element is of this type. */
7 public static boolean isDbk(Content content, DbkType type) {
8 return content.isContentClass(type.qName());
9 }
10
11 public static String getMediaFileref(Content node) {
12 Content mediadata;
13 if (node.hasChild(DbkType.imageobject)) {
14 mediadata = node.child(DbkType.imageobject).child(DbkType.imagedata);
15 } else {
16 mediadata = node.child(DbkType.videoobject).child(DbkType.videodata);
17 }
18
19 if (mediadata.containsKey(DbkAttr.fileref)) {
20 return mediadata.attr(DbkAttr.fileref);
21 } else {
22 return null;
23 }
24 }
25
26 /** singleton */
27 private DbkAcrUtils() {
28 }
29 }