X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=gis%2Fruntime%2Forg.argeo.gis.geotools%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fgeotools%2Fjcr%2FGeoJcrIndex.java;h=7e4f28702cf726e9ab7ee9a39b11420b9d80d7c0;hb=78a52c7ee4e476b3fe366346ed26315f7237a6bb;hp=75c1b81ad745b30e2e9ddc85ee3fc38393e50653;hpb=03db65bd74ce09b696a4c5af15a58df988e5368d;p=lgpl%2Fargeo-commons.git diff --git a/gis/runtime/org.argeo.gis.geotools/src/main/java/org/argeo/geotools/jcr/GeoJcrIndex.java b/gis/runtime/org.argeo.gis.geotools/src/main/java/org/argeo/geotools/jcr/GeoJcrIndex.java index 75c1b81ad..7e4f28702 100644 --- a/gis/runtime/org.argeo.gis.geotools/src/main/java/org/argeo/geotools/jcr/GeoJcrIndex.java +++ b/gis/runtime/org.argeo.gis.geotools/src/main/java/org/argeo/geotools/jcr/GeoJcrIndex.java @@ -26,7 +26,6 @@ import org.argeo.jcr.JcrUtils; import org.argeo.jcr.gis.GisNames; import org.argeo.jcr.gis.GisTypes; import org.argeo.jts.jcr.JtsJcrUtils; -import org.argeo.security.SystemExecutionService; import org.geotools.data.DataStore; import org.geotools.data.DefaultTransaction; import org.geotools.data.FeatureStore; @@ -63,12 +62,16 @@ public class GeoJcrIndex implements EventListener, GisNames, GisTypes { // TODO: use common factory finder? private FilterFactory2 ff = new FilterFactoryImpl(); + /** Expects to execute with system authentication */ public void init() { - systemExecutionService.execute(new Runnable() { - public void run() { - initGeoJcrIndex(); - } - }); + if (systemExecutionService != null)// legacy + systemExecutionService.execute(new Runnable() { + public void run() { + initGeoJcrIndex(); + } + }); + else + initGeoJcrIndex(); } protected void initGeoJcrIndex() { @@ -201,7 +204,7 @@ public class GeoJcrIndex implements EventListener, GisNames, GisTypes { if (node.isNodeType(GIS_LOCATED)) { locatedNode = node; } else if (node.isNodeType(GIS_INDEXED)) { - locatedNode = findLocatedparent(node); + locatedNode = findLocatedParent(node); } else { throw new ArgeoException("Unsupported node " + node); } @@ -231,12 +234,12 @@ public class GeoJcrIndex implements EventListener, GisNames, GisTypes { } } - protected Node findLocatedparent(Node child) { + protected Node findLocatedParent(Node child) { try { if (child.getParent().isNodeType(GIS_LOCATED)) return child.getParent(); else - return findLocatedparent(child.getParent()); + return findLocatedParent(child.getParent()); } catch (Exception e) { // also if child is root node throw new ArgeoException("Cannot find located parent", e); @@ -292,8 +295,7 @@ public class GeoJcrIndex implements EventListener, GisNames, GisTypes { this.session = session; } - public void setSystemExecutionService( - Executor systemExecutionService) { + public void setSystemExecutionService(Executor systemExecutionService) { this.systemExecutionService = systemExecutionService; }