@Test public void testConfiguration() { DocumentGrapherExecutionContext ctx = JsonHelperConfiguration.newContext(db, log); Assert.assertTrue(ctx.getDb() == db); Assert.assertTrue(ctx.getLog() == log); Assert.assertEquals("_root_",ctx.getRootNodeKeyProperty()); Assert.assertTrue(ctx.getDocumentIdBuilder() instanceof DocumentIdBuilderId); Assert.assertTrue(ctx.getDocumentRelationBuilder() instanceof DocumentRelationBuilderByKey); Assert.assertTrue(ctx.getDocumentLabelBuilder() instanceof DocumentLabelBuilderById); }
public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); } }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log); static void reset(); }
JsonHelperConfiguration { public static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log) { if(instance == null) { Node configurationNode = db.findNode(Label.label("JSON_CONFIG"), "configuration", "byNode"); if(configurationNode == null) { log.info("Load default configuration: "+JsonHelperConfigurationDefault.class); instance = new JsonHelperConfigurationDefault(); }else { log.info("Load configuration from node: "+JsonHelperConfigurationByNode.class); instance = new JsonHelperConfigurationByNode(configurationNode); } } return instance.buildContext(db, log); }  static DocumentGrapherExecutionContext newContext(GraphDatabaseService db, Log log); static void reset();  }