private PropertiesModuleManager getModulesManager() { String timestampFile = hubConfig.getHubProject().getUserModulesDeployTimestampFile(); PropertiesModuleManager pmm = new PropertiesModuleManager(timestampFile); // Need to delete ml-javaclient-utils timestamp file as well as modules present in the standard gradle locations are now // loaded by the modules loader in the parent class which adds these entries to the ml-javaclient-utils timestamp file String filePath = hubConfig.getAppConfig().getModuleTimestampsPath(); File defaultTimestampFile = new File(filePath); if (forceLoad) { pmm.deletePropertiesFile(); if (defaultTimestampFile.exists()){ defaultTimestampFile.delete(); } } return pmm; }
@Override public void execute(CommandContext context) { AppConfig appConfig = context.getAppConfig(); DatabaseClient client = appConfig.newDatabaseClient(); EntityServicesManager mgr = new EntityServicesManager(client); CodeGenerationRequest request = createCodeGenerationRequest(); List<File> entityFiles = findEntityFiles(); if (!entityFiles.isEmpty()) { //create map of entity name -> entity definition file Map<String,File> entityNameFileMap = createEntityNameFileMap(entityFiles); logger.debug("Found the following entities->files: {} " + entityNameFileMap); filterEntities(entityNameFileMap); if (!entityNameFileMap.isEmpty()) { logger.warn("About to generate a template for the following entities: {} into directory {} ", entityNameFileMap.keySet(), hubConfig.getAppConfig().getSchemasPath()); for (File f : entityNameFileMap.values()) { GeneratedCode code = loadModelDefinition(request, f, mgr); generateExtractionTemplate(appConfig, code); } } } else { logger.info("No data hub entity files found under {} or its sub-directories.", hubConfig.getHubEntitiesDir()); } }
public String getMarkLogicVersion() { // this call specifically needs to access marklogic without a known database ServerEvaluationCall eval = hubConfig.getAppConfig().newAppServicesDatabaseClient(null).newServerEval(); String xqy = "xdmp:version()"; EvalResultIterator result = eval.xquery(xqy).eval(); if (result.hasNext()) { return result.next().getString(); } else { throw new RuntimeException("Couldn't determine MarkLogic Version"); } }
String modulesDatabaseName = hubConfig.getAppConfig().getModulesDatabaseName(); ManageConfig manageConfig = context.getManageClient().getManageConfig(); String securityUsername = manageConfig.getSecurityUsername();
String modulesDatabaseName = hubConfig.getAppConfig().getModulesDatabaseName(); ManageConfig manageConfig = context.getManageClient().getManageConfig(); String securityUsername = manageConfig.getSecurityUsername(); String modulesDatabaseName = hubConfig.getAppConfig().getModulesDatabaseName(); ManageClient manageClient = context.getManageClient();
protected void installUserModules(HubConfig hubConfig, boolean force) { logger.debug("Installing user modules into MarkLogic"); List<Command> commands = new ArrayList<>(); loadUserModulesCommand.setForceLoad(force); commands.add(loadUserModulesCommand); LoadModulesCommand loadModulesCommand = new LoadModulesCommand(); commands.add(loadModulesCommand); SimpleAppDeployer deployer = new SimpleAppDeployer(((HubConfigImpl)hubConfig).getManageClient(), ((HubConfigImpl)hubConfig).getAdminManager()); deployer.setCommands(commands); deployer.deploy(hubConfig.getAppConfig()); }
bean.setUsername(hubConfig.getAppConfig().getAppServicesUsername()); bean.setPassword(hubConfig.getAppConfig().getAppServicesPassword());
propsStream.close(); assertEquals(config.getAppConfig().getHost(), props.getProperty("mlHost"));
@Test public void testAmpLoading() { HubConfig config = getHubAdminConfig(); LoadHubModulesCommand loadHubModulesCommand = new LoadHubModulesCommand(); loadHubModulesCommand.setHubConfig(config); ManageClient manageClient = new ManageClient(new com.marklogic.mgmt.ManageConfig(host, 8002, secUser, secPassword)); CommandContext commandContext = new CommandContext(config.getAppConfig(), manageClient, null); deployHubAmpsCommand.setHubConfig(config); deployHubAmpsCommand.execute(commandContext); } }