- @Override
- public DraftStatusBean perform(ReadGraph graph) throws DatabaseException {
- boolean published = Layer0Utils.isPublished(graph, resource);
- if(!published) return new DraftStatusBean(new String[0]);
- return null;
- }
-
+ return result;
+ }
+
+ private Set<Resource> toRoots(ReadGraph graph, Collection<Resource> resources) throws DatabaseException {
+ Set<Resource> result = new HashSet<>();
+ for (Resource sel : selection) {
+ Resource root = graph.syncRequest(new PossibleIndexRoot(sel));
+ if (root != null)
+ result.add(root);
+ }
+ return result;
+ }
+
+ private LibraryInfo library(ReadGraph graph, Resource library) throws DatabaseException {
+ return new LibraryInfo(
+ NameLabelUtil.modalName(graph, library, NameLabelMode.NAME),
+ library,
+ isDraft(graph, library));
+ }
+
+ private DraftStatusBean isDraft(ReadGraph graph, Resource resource) throws DatabaseException {
+ return Layer0Utils.isPublished(graph, resource) ? null : new DraftStatusBean(new String[0]);
+ }