# HG changeset patch # User Robert Casties # Date 1499705620 -7200 # Node ID 68e3e4b569f9f9fa92855732608e25ca6819846f # Parent 979604ccc6dbf0fcb8440a9dfccb1d04bb95eb5b add searchEntityByPublic(). diff -r 979604ccc6db -r 68e3e4b569f9 src/main/java/org/mpi/openmind/cache/WrapperService.java --- a/src/main/java/org/mpi/openmind/cache/WrapperService.java Mon Jul 10 18:53:04 2017 +0200 +++ b/src/main/java/org/mpi/openmind/cache/WrapperService.java Mon Jul 10 18:53:40 2017 +0200 @@ -90,6 +90,26 @@ return rs; } + /** + * Returns a List with all entities having the given isPublic state. + * + * @param oc + * @param isPublic + * @return + */ + public List searchEntityByPublic(String oc, Boolean isPublic) { + List rs = new ArrayList(); + + List entList = this.cache.loadEntitiesByDef(oc); + + for (Entity ent : entList) { + if (ent.getIsPublic() == isPublic) { + rs.add(ent); + } + } + return rs; + } + // ************************************************************ // ************************************************************ // ************************************************************