graphdb-workbench 2.3.0-TR7 → 2.3.0-TR8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{108.112426f55d9e34a78ab3.bundle.js → 108.7199f12abac98c8182cd.bundle.js} +1 -1
  2. package/dist/{108.112426f55d9e34a78ab3.bundle.js.map → 108.7199f12abac98c8182cd.bundle.js.map} +1 -1
  3. package/dist/11.4928d8d13ff46f3872bb.bundle.js +1 -1
  4. package/dist/11.4928d8d13ff46f3872bb.bundle.js.map +1 -1
  5. package/dist/148.45985ae23de642595544.bundle.js +1 -1
  6. package/dist/148.45985ae23de642595544.bundle.js.map +1 -1
  7. package/dist/20.4eb25ede434dc329ecf1.bundle.js +1 -1
  8. package/dist/20.4eb25ede434dc329ecf1.bundle.js.map +1 -1
  9. package/dist/{21.62777310f384dd7b71a4.bundle.js → 21.b8c57ce9c9688adcf29c.bundle.js} +1 -1
  10. package/dist/{21.62777310f384dd7b71a4.bundle.js.map → 21.b8c57ce9c9688adcf29c.bundle.js.map} +1 -1
  11. package/dist/27.fef157d9275358c9f1a0.bundle.js +1 -1
  12. package/dist/27.fef157d9275358c9f1a0.bundle.js.map +1 -1
  13. package/dist/33.fde8076c81c87c25c367.bundle.js +1 -1
  14. package/dist/33.fde8076c81c87c25c367.bundle.js.map +1 -1
  15. package/dist/40.10f42e3f6d8d87bd3221.bundle.js +1 -1
  16. package/dist/40.10f42e3f6d8d87bd3221.bundle.js.map +1 -1
  17. package/dist/5.5e565a2f6404b3c60148.bundle.js +2 -0
  18. package/dist/5.5e565a2f6404b3c60148.bundle.js.map +1 -0
  19. package/dist/94.94158487a9024ff3a623.bundle.js +1 -1
  20. package/dist/94.94158487a9024ff3a623.bundle.js.map +1 -1
  21. package/dist/{bundle.896281e5e7a26024597b.bundle.js → bundle.0cdc9c2787cb0740de6d.bundle.js} +3 -3
  22. package/dist/{bundle.896281e5e7a26024597b.bundle.js.map → bundle.0cdc9c2787cb0740de6d.bundle.js.map} +1 -1
  23. package/dist/index.html +3 -3
  24. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  25. package/dist/pages/autocomplete.html +1 -1
  26. package/dist/pages/choose-repository-type.html +1 -1
  27. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  28. package/dist/pages/create-index.html +4 -4
  29. package/dist/pages/dependencies.html +1 -1
  30. package/dist/pages/domainRangeInfo.html +2 -2
  31. package/dist/pages/edit.html +1 -1
  32. package/dist/pages/explore.html +1 -1
  33. package/dist/pages/export.html +1 -1
  34. package/dist/pages/find.html +1 -1
  35. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  36. package/dist/pages/graphs-visualizations.html +7 -7
  37. package/dist/pages/guides.html +1 -1
  38. package/dist/pages/import.html +1 -1
  39. package/dist/pages/jdbc-create.html +5 -5
  40. package/dist/pages/monitor/queries.html +1 -1
  41. package/dist/pages/monitor/resources.html +2 -2
  42. package/dist/pages/namespaces.html +2 -2
  43. package/dist/pages/plugins.html +1 -1
  44. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  45. package/dist/pages/rdfrank.html +2 -2
  46. package/dist/pages/repositories.html +2 -2
  47. package/dist/pages/repository.html +2 -2
  48. package/dist/pages/similarity-indexes.html +1 -1
  49. package/dist/pages/sparql-template-create.html +5 -5
  50. package/dist/pages/sparql.html +3 -3
  51. package/dist/pages/webapi.html +2 -2
  52. package/dist/res/swagger/index.html +27 -27
  53. package/package.json +1 -1
  54. package/dist/5.b0829613ef25834bf1ab.bundle.js +0 -2
  55. package/dist/5.b0829613ef25834bf1ab.bundle.js.map +0 -1
@@ -1,2 +1,2 @@
1
1
  (window.webpackJsonp=window.webpackJsonp||[]).push([[108],{99:function(e,r,o){"use strict";o.r(r);var t=o(66);function i(e,r,o,i,s){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(a){a.ontopProperiesLink="https://ontop-vkg.org/guide/advanced/configuration.html",a.selectedDriver={driverType:"generic",driverName:"Generic JDBC Driver",jdbc:{hostName:"",port:"",databaseName:"",userName:"",password:"",driverClass:"",url:""},urlTemplate:"",downloadDriverUrl:""},a.ontopRepoFileNames={},a.supportedDriversData=[],a.ontopRepoFileLabels={propertiesFile:"JDBC properties",obdaFile:"OBDA or R2RML",owlFile:"ontology file",constraintFile:"constraint file",lensesFile:"lenses file",dbMetadataFile:"DB metadata file"},a.ontopRepoFiles=Object.keys(a.ontopRepoFileLabels),a.ontopRepoFiles.forEach((function(e){a.repositoryInfo.params[e]&&(a.ontopRepoFileNames[e]=Object(t.getFileName)(a.repositoryInfo.params[e].value))})),a.supportedDriverLabels={hostName:"Hostname",port:"Port",databaseName:"Database name",userName:"Username",password:"Password",driverClass:"Driver class",url:"URL"},a.propertiesFileParams=Object.keys(a.supportedDriverLabels),a.classAvailable=!1,a.genericDriverType="generic",a.propertiesFile="propertiesFile";const n=[a.propertiesFile,"obdaFile"],l=["hostName","databaseName","userName"];function p(){return a.selectedDriver.driverType!==a.genericDriverType?l.filter((function(e){return!a.selectedDriver.jdbc[e]})).length>0&&(o.error(s.instant("missing.required.field.error")),1)?Promise.reject(s.instant("missing.required.field.error")):(a.uploadFileLoader=!0,r.updatePropertiesFile(a.repositoryInfo.params[a.propertiesFile].value,a.selectedDriver.jdbc,a.repositoryInfo.location).success((function(e){a.ontopRepoFileNames[a.propertiesFile]=Object(t.getFileName)(e.fileLocation),a.repositoryInfo.params[a.propertiesFile].value=e.fileLocation,a.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),a.uploadFileLoader=!1}))):Promise.resolve()}function c(e,r){const t=getError(r);o.error(t,e)}a.loadDriverByClass=function(e){const r=a.supportedDriversData.find(r=>r.driverClass===e);return r&&a.copyDriverProperties(r),r},a.selectDriverByType=function(e){a.constructCustomFiledForDriver(e),a.copyDriverProperties(a.supportedDriversData.find(r=>r.driverType===e)),a.concatURL("hostName",a)},a.constructCustomFiledForDriver=function(e){switch(a.supportedDriverLabels.databaseName="Database name",a.supportedDriverLabels.hostName="Hostname",e){case"snowflake":a.supportedDriverLabels.hostName="Account identifier",a.supportedDriverLabels.databaseName="Warehouse";break;case"databricks":a.supportedDriverLabels.databaseName="HttpPath";break;case"dremio":a.supportedDriverLabels.databaseName="Schema"}},a.copyDriverProperties=function(e){a.selectedDriver.driverType=e.driverType,a.selectedDriver.jdbc.driverClass=e.driverClass,a.selectedDriver.jdbc.url=e.urlTemplate,a.selectedDriver.urlTemplate=e.urlTemplate,a.selectedDriver.downloadDriverUrl=e.downloadDriverUrl,a.selectedDriver.portRequired=e.portRequired,a.classAvailable=e.classAvailable},a.isReadOnly=function(e){return"driverClass"===e||"url"===e},a.editFile=function(o){e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",resolve:{file:function(){return a.repositoryInfo.params[o]?a.repositoryInfo.params[o].value:""}}}).result.then((function(e){r.updateRepositoryFileContent(e.fileLocation,e.content,a.repositoryInfo.location).success((function(e){a.ontopRepoFileNames[o]=Object(t.getFileName)(e.fileLocation),a.repositoryInfo.params[o].value=e.fileLocation})).error((function(e){c(s.instant("common.error"),e)}))}))},a.uploadOntopRepoFile=function(e,r){e&&e.length&&(a.uploadFile=e[0],a.uploadFileLoader=!0,i.upload({url:"rest/repositories/file/upload",data:{file:a.uploadFile,location:a.repositoryInfo.location}}).success((function(e){e.success?(a.ontopRepoFileNames[r]=a.uploadFile.name,a.repositoryInfo.params[r].value=e.fileLocation):o.error(e.errorMessage),a.uploadFileLoader=!1})).error((function(e){c(s.instant("common.error"),e),a.uploadFile="",a.uploadFileLoader=!1})))},a.concatURL=function(e){if("hostName"===e||"port"===e||"databaseName"===e){let e=a.selectedDriver.urlTemplate;a.selectedDriver.jdbc.hostName&&(e=a.selectedDriver.jdbc.port?e.replace("{hostport}",`${a.selectedDriver.jdbc.hostName}:${a.selectedDriver.jdbc.port}`):e.replace("{hostport}",a.selectedDriver.jdbc.hostName)),a.selectedDriver.jdbc.databaseName&&(e=e.replace("{database}",a.selectedDriver.jdbc.databaseName)),a.selectedDriver.jdbc.url=e}},a.getInputType=function(e){switch(e){case"password":return"password";case"port":return"number";default:return"text"}},a.checkForRequiredOntopFiles=function(){return p().then((function(){return n.filter((function(e){return!a.repositoryInfo.params[e].value})).length>0?(o.error(s.instant("ontop.repo.missing.required.file.error")),Promise.reject(s.instant("ontop.repo.missing.required.file.error"))):Promise.resolve()}))},a.validateOntopPropertiesConnection=function(){p().then((function(){r.validateOntopPropertiesConnection(a.repositoryInfo).success((function(){o.success(s.instant("ontop.repo.successful.connection.msg"))})).error((function(e){c(s.instant("ontop.repo.failed.to.connect"),e)}))}))},a.isOntopRepoFileUploaded=function(){return a.repositoryInfo.params.propertiesFile&&a.repositoryInfo.params.propertiesFile.value.length>0},a.isRequiredOntopRepoFile=function(e){return n.indexOf(e)>-1},a.isRequiredField=function(e){return l.indexOf(e)>-1||"port"===e&&a.selectedDriver.portRequired},a.getFieldTooltip=function(e){return"port"===e&&a.selectedDriver.portRequired&&(e="portIfRequired"),s.instant("repoTooltips.ontop."+e)},a.editOntopRepo=function(){a.checkForRequiredOntopFiles().then((function(){a.editRepository()})).catch((function(e){}))},a.createOntopRepo=function(){a.repositoryInfo.id?a.checkForRequiredOntopFiles().then((function(){a.createRepo()})).catch((function(e){})):o.error(s.instant("empty.repoid.warning"))},a.goBackToPrevious=function(){a.goBackToPreviousLocation()},r.getSupportedDriversData(a.repositoryInfo).success((function(e){a.supportedDriversData=e})).error((function(e){c(s.instant("common.error"),e)})).then((function(){a.editRepoPage&&r.loadPropertiesFile(a.repositoryInfo.params[a.propertiesFile].value,a.repositoryInfo.location).success((function(e){a.loadDriverByClass(e.driverClass)&&(a.selectedDriver.jdbc.hostName=e.hostName,a.selectedDriver.jdbc.port=parseInt(e.port),a.selectedDriver.jdbc.databaseName=e.databaseName,a.selectedDriver.jdbc.userName=e.userName,a.selectedDriver.jdbc.password=e.password,a.selectedDriver.jdbc.url=e.url)})).error((function(e){c(s.instant("common.error"),e),a.uploadFileLoader=!1}))}))}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",i),i.$inject=["$uibModal","RepositoriesRestService","toastr","Upload","$translate"]}}]);
2
- //# sourceMappingURL=108.112426f55d9e34a78ab3.bundle.js.map
2
+ //# sourceMappingURL=108.7199f12abac98c8182cd.bundle.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///./src/js/angular/repositories/ontop-repo.directive.js"],"names":["ontopRepoDirective","$uibModal","RepositoriesRestService","toastr","Upload","$translate","restrict","scope","templateUrl","link","$scope","ontopProperiesLink","selectedDriver","driverType","driverName","jdbc","hostName","port","databaseName","userName","password","driverClass","url","urlTemplate","downloadDriverUrl","ontopRepoFileNames","supportedDriversData","ontopRepoFileLabels","propertiesFile","obdaFile","owlFile","constraintFile","lensesFile","dbMetadataFile","ontopRepoFiles","Object","keys","forEach","key","repositoryInfo","params","value","supportedDriverLabels","propertiesFileParams","classAvailable","genericDriverType","REQUIRED_ONTOP_REPO_PARAMS","REQUIRED_PROPERTIES_FIELD_PARAMS","updateProperties","filter","requiredField","length","error","instant","Promise","reject","uploadFileLoader","updatePropertiesFile","location","success","data","fileLocation","showErrorMsg","resolve","title","msg","getError","loadDriverByClass","foundDriver","find","driver","copyDriverProperties","selectDriverByType","constructCustomFiledForDriver","concatURL","portRequired","isReadOnly","labelName","editFile","file","open","controller","result","then","updateRepositoryFileContent","content","uploadOntopRepoFile","files","param","uploadFile","upload","name","errorMessage","replace","getInputType","checkForRequiredOntopFiles","requiredFile","validateOntopPropertiesConnection","isOntopRepoFileUploaded","isRequiredOntopRepoFile","indexOf","isRequiredField","field","getFieldTooltip","editOntopRepo","editRepository","catch","err","createOntopRepo","id","createRepo","goBackToPrevious","goBackToPreviousLocation","getSupportedDriversData","response","editRepoPage","loadPropertiesFile","driverData","parseInt","angular","module","directive","$inject"],"mappings":"2FAAA,mBAWA,SAASA,EAAm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SAAUQ,GACnBE,EAAazD,EAAWgD,QAAQ,gBAAiBO,GACjDlD,EAAO8C,kBAAmB,UA3N1C+D,QACKC,OAAO,sDAAuD,IAC9DC,UAAU,YAAazH,GAE5BA,EAAmB0H,QAAU,CAAC,YAAa,0BAA2B,SAAU,SAAU","file":"108.112426f55d9e34a78ab3.bundle.js","sourcesContent":["import {getFileName} from \"./controllers\";\n\n// A link to Ontop's website with all Ontop configuration keys\nconst ONTOP_PROPERTIES_LINK = 'https://ontop-vkg.org/guide/advanced/configuration.html';\n\nangular\n .module('graphdb.framework.repositories.ontop-repo.directive', [])\n .directive('ontopRepo', ontopRepoDirective);\n\nontopRepoDirective.$inject = ['$uibModal', 'RepositoriesRestService', 'toastr', 'Upload', '$translate'];\n\nfunction ontopRepoDirective($uibModal, RepositoriesRestService, toastr, Upload, $translate) {\n return {\n restrict: 'E',\n scope: false,\n templateUrl: 'js/angular/repositories/templates/ontop-repo.html',\n\n link: linkFunc\n };\n\n function linkFunc($scope) {\n $scope.ontopProperiesLink = ONTOP_PROPERTIES_LINK;\n $scope.selectedDriver = {\n driverType: \"generic\",\n driverName: \"Generic JDBC Driver\",\n jdbc: {\n hostName: \"\",\n port: \"\",\n databaseName: \"\",\n userName: \"\",\n password: \"\",\n driverClass: \"\",\n url: \"\"\n },\n urlTemplate: \"\",\n downloadDriverUrl: \"\"\n };\n $scope.ontopRepoFileNames = {};\n $scope.supportedDriversData = [];\n $scope.ontopRepoFileLabels =\n {propertiesFile: 'JDBC properties', obdaFile: 'OBDA or R2RML', owlFile: 'ontology file',\n constraintFile: 'constraint file', lensesFile: 'lenses file', dbMetadataFile: 'DB metadata file'};\n $scope.ontopRepoFiles = Object.keys($scope.ontopRepoFileLabels);\n $scope.ontopRepoFiles.forEach(function(key) {\n if ($scope.repositoryInfo.params[key]) {\n $scope.ontopRepoFileNames[key] = getFileName($scope.repositoryInfo.params[key].value);\n }\n });\n $scope.supportedDriverLabels = {hostName: 'Hostname', port: \"Port\", databaseName: 'Database name',\n userName: 'Username', password: 'Password', driverClass: 'Driver class', url: 'URL'};\n $scope.propertiesFileParams = Object.keys($scope.supportedDriverLabels);\n $scope.classAvailable = false;\n $scope.genericDriverType = 'generic';\n $scope.propertiesFile = 'propertiesFile';\n\n const REQUIRED_ONTOP_REPO_PARAMS = [$scope.propertiesFile, 'obdaFile'];\n const REQUIRED_PROPERTIES_FIELD_PARAMS = ['hostName', 'databaseName', 'userName'];\n\n function getSupportedDriversData() {\n return RepositoriesRestService.getSupportedDriversData($scope.repositoryInfo)\n .success(function (response) {\n $scope.supportedDriversData = response;\n }).error(function (response) {\n showErrorMsg($translate.instant('common.error'), response);\n });\n }\n\n $scope.loadDriverByClass = function (driverClass) {\n const foundDriver = $scope.supportedDriversData\n .find((driver) => driver.driverClass === driverClass);\n if (foundDriver) {\n $scope.copyDriverProperties(foundDriver);\n }\n return foundDriver;\n };\n\n $scope.selectDriverByType = function (driverType) {\n $scope.constructCustomFiledForDriver(driverType);\n\n $scope.copyDriverProperties($scope.supportedDriversData\n .find((driver) => driver.driverType === driverType));\n // Call concatURL with proper labelName to apply changes to url field\n $scope.concatURL('hostName', $scope);\n };\n\n $scope.constructCustomFiledForDriver = function (driver) {\n $scope.supportedDriverLabels.databaseName = 'Database name';\n $scope.supportedDriverLabels.hostName = 'Hostname';\n switch (driver) {\n case 'snowflake':\n $scope.supportedDriverLabels.hostName = 'Account identifier';\n $scope.supportedDriverLabels.databaseName = 'Warehouse';\n break;\n case 'databricks':\n $scope.supportedDriverLabels.databaseName = 'HttpPath';\n break;\n case 'dremio':\n $scope.supportedDriverLabels.databaseName = 'Schema';\n break;\n }\n };\n\n $scope.copyDriverProperties = function (driver) {\n $scope.selectedDriver.driverType = driver.driverType;\n $scope.selectedDriver.jdbc.driverClass = driver.driverClass;\n $scope.selectedDriver.jdbc.url = driver.urlTemplate;\n $scope.selectedDriver.urlTemplate = driver.urlTemplate;\n $scope.selectedDriver.downloadDriverUrl = driver.downloadDriverUrl;\n $scope.selectedDriver.portRequired = driver.portRequired;\n $scope.classAvailable = driver.classAvailable;\n };\n\n $scope.isReadOnly = function (labelName) {\n return labelName === 'driverClass' || labelName === 'url';\n }\n\n $scope.editFile = function(file) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/templates/modal/editRepoFile.html',\n controller: 'EditRepositoryFileCtrl',\n resolve: {\n file: function () {\n return $scope.repositoryInfo.params[file] ? $scope.repositoryInfo.params[file].value : '';\n }\n }\n });\n\n modalInstance.result.then(function (data) {\n // send data to backend\n RepositoriesRestService.updateRepositoryFileContent(data.fileLocation, data.content, $scope.repositoryInfo.location).success(function(result) {\n $scope.ontopRepoFileNames[file] = getFileName(result.fileLocation);\n $scope.repositoryInfo.params[file].value = result.fileLocation;\n }).error(function (error) {\n showErrorMsg($translate.instant('common.error'), error);\n })\n });\n }\n\n $scope.uploadOntopRepoFile = function(files, param) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories/file/upload',\n data: {file: $scope.uploadFile, location: $scope.repositoryInfo.location}\n })\n .success(function (data) {\n if (!data.success) {\n toastr.error(data.errorMessage);\n } else {\n $scope.ontopRepoFileNames[param] = $scope.uploadFile.name;\n $scope.repositoryInfo.params[param].value = data.fileLocation;\n }\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFile = '';\n $scope.uploadFileLoader = false;\n });\n }\n }\n\n $scope.concatURL = function(labelName) {\n if (labelName === 'hostName' || labelName === 'port' || labelName === 'databaseName') {\n let result = $scope.selectedDriver.urlTemplate;\n if ($scope.selectedDriver.jdbc.hostName) {\n if ($scope.selectedDriver.jdbc.port) {\n result = result.replace('{hostport}',\n `${$scope.selectedDriver.jdbc.hostName}:${$scope.selectedDriver.jdbc.port}`);\n } else {\n result = result.replace('{hostport}', $scope.selectedDriver.jdbc.hostName);\n }\n }\n\n if ($scope.selectedDriver.jdbc.databaseName) {\n result = result.replace('{database}', $scope.selectedDriver.jdbc.databaseName);\n }\n\n $scope.selectedDriver.jdbc.url = result;\n }\n }\n\n $scope.getInputType = function (labelName) {\n switch (labelName) {\n case 'password':\n return 'password';\n case 'port':\n return 'number';\n default:\n return 'text';\n }\n }\n\n $scope.checkForRequiredOntopFiles = function () {\n // Should guarantee that code will be executed in sequential manner,\n // because properties file is not created yet\n return updateProperties()\n .then(function () {\n const missingRequired = REQUIRED_ONTOP_REPO_PARAMS.filter(function (requiredFile) {\n return !$scope.repositoryInfo.params[requiredFile].value;\n });\n if (missingRequired.length > 0) {\n toastr.error($translate.instant('ontop.repo.missing.required.file.error'));\n return Promise.reject($translate.instant('ontop.repo.missing.required.file.error'));\n }\n return Promise.resolve();\n });\n }\n\n function loadPropertiesFile() {\n RepositoriesRestService.loadPropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.repositoryInfo.location)\n .success(function (driverData) {\n const driver = $scope.loadDriverByClass(driverData.driverClass);\n // If driver class is not found means that the selected driver is a GENERIC ONE\n if (driver) {\n $scope.selectedDriver.jdbc.hostName = driverData.hostName;\n $scope.selectedDriver.jdbc.port = parseInt(driverData.port);\n $scope.selectedDriver.jdbc.databaseName = driverData.databaseName;\n $scope.selectedDriver.jdbc.userName = driverData.userName;\n $scope.selectedDriver.jdbc.password = driverData.password;\n $scope.selectedDriver.jdbc.url = driverData.url;\n }\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.validateOntopPropertiesConnection = function () {\n updateProperties()\n .then(function () {\n RepositoriesRestService.validateOntopPropertiesConnection($scope.repositoryInfo)\n .success(function () {\n toastr.success($translate.instant('ontop.repo.successful.connection.msg'));\n }).error(function (data) {\n showErrorMsg($translate.instant('ontop.repo.failed.to.connect'), data);\n });\n });\n }\n\n $scope.isOntopRepoFileUploaded = function() {\n return $scope.repositoryInfo.params.propertiesFile &&\n $scope.repositoryInfo.params.propertiesFile.value.length > 0\n };\n\n function missingRequiredField() {\n const missing = REQUIRED_PROPERTIES_FIELD_PARAMS\n .filter(function (requiredField) {\n return !$scope.selectedDriver.jdbc[requiredField]\n });\n if (missing.length > 0) {\n toastr.error($translate.instant('missing.required.field.error'));\n return true;\n }\n return false;\n }\n\n function updateProperties() {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (missingRequiredField()) {\n return Promise.reject($translate.instant('missing.required.field.error'));\n }\n return updatePropertiesFile();\n }\n return Promise.resolve();\n }\n\n function updatePropertiesFile() {\n $scope.uploadFileLoader = true;\n return RepositoriesRestService\n .updatePropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.selectedDriver.jdbc, $scope.repositoryInfo.location)\n .success(function (data) {\n $scope.ontopRepoFileNames[$scope.propertiesFile] = getFileName(data.fileLocation);\n $scope.repositoryInfo.params[$scope.propertiesFile].value = data.fileLocation;\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.isRequiredOntopRepoFile = function(file) {\n return REQUIRED_ONTOP_REPO_PARAMS.indexOf(file) > -1;\n };\n\n $scope.isRequiredField = function (field) {\n return REQUIRED_PROPERTIES_FIELD_PARAMS.indexOf(field) > -1\n || field === 'port' && $scope.selectedDriver.portRequired;\n };\n\n $scope.getFieldTooltip = function (field) {\n if (field === 'port' && $scope.selectedDriver.portRequired) {\n field = 'portIfRequired';\n }\n return $translate.instant('repoTooltips.ontop.' + field);\n };\n\n $scope.editOntopRepo = function () {\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.editRepository();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n }\n\n $scope.createOntopRepo = function () {\n if (!$scope.repositoryInfo.id) {\n toastr.error($translate.instant('empty.repoid.warning'));\n return;\n }\n\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.createRepo();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n };\n\n $scope.goBackToPrevious = function () {\n $scope.goBackToPreviousLocation();\n }\n\n function showErrorMsg (title, data) {\n const msg = getError(data);\n toastr.error(msg, title);\n }\n\n getSupportedDriversData()\n .then(function () {\n if ($scope.editRepoPage) {\n loadPropertiesFile();\n }\n });\n }\n}\n"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///./src/js/angular/repositories/ontop-repo.directive.js"],"names":["ontopRepoDirective","$uibModal","RepositoriesRestService","toastr","Upload","$translate","restrict","scope","templateUrl","link","$scope","ontopProperiesLink","selectedDriver","driverType","driverName","jdbc","hostName","port","databaseName","userName","password","driverClass","url","urlTemplate","downloadDriverUrl","ontopRepoFileNames","supportedDriversData","ontopRepoFileLabels","propertiesFile","obdaFile","owlFile","constraintFile","lensesFile","dbMetadataFile","ontopRepoFiles","Object","keys","forEach","key","repositoryInfo","params","value","supportedDriverLabels","propertiesFileParams","classAvailable","genericDriverType","REQUIRED_ONTOP_REPO_PARAMS","REQUIRED_PROPERTIES_FIELD_PARAMS","updateProperties","filter","requiredField","length","error","instant","Promise","reject","uploadFileLoader","updatePropertiesFile","location","success","data","fileLocation","showErrorMsg","resolve","title","msg","getError","loadDriverByClass","foundDriver","find","driver","copyDriverProperties","selectDriverByType","constructCustomFiledForDriver","concatURL","portRequired","isReadOnly","labelName","editFile","file","open","controller","result","then","updateRepositoryFileContent","content","uploadOntopRepoFile","files","param","uploadFile","upload","name","errorMessage","replace","getInputType","checkForRequiredOntopFiles","requiredFile","validateOntopPropertiesConnection","isOntopRepoFileUploaded","isRequiredOntopRepoFile","indexOf","isRequiredField","field","getFieldTooltip","editOntopRepo","editRepository","catch","err","createOntopRepo","id","createRepo","goBackToPrevious","goBackToPreviousLocation","getSupportedDriversData","response","editRepoPage","loadPropertiesFile","driverData","parseInt","angular","module","directive","$inject"],"mappings":"2FAAA,mBAWA,SAASA,EAAmBC,EAAWC,EAAyBC,EAAQC,EAAQC,GAC5E,MAAO,CACHC,SAAU,IACVC,OAA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AmB,UA3N1C+D,QACKC,OAAO,sDAAuD,IAC9DC,UAAU,YAAazH,GAE5BA,EAAmB0H,QAAU,CAAC,YAAa,0BAA2B,SAAU,SAAU","file":"108.7199f12abac98c8182cd.bundle.js","sourcesContent":["import {getFileName} from \"./controllers\";\n\n// A link to Ontop's website with all Ontop configuration keys\nconst ONTOP_PROPERTIES_LINK = 'https://ontop-vkg.org/guide/advanced/configuration.html';\n\nangular\n .module('graphdb.framework.repositories.ontop-repo.directive', [])\n .directive('ontopRepo', ontopRepoDirective);\n\nontopRepoDirective.$inject = ['$uibModal', 'RepositoriesRestService', 'toastr', 'Upload', '$translate'];\n\nfunction ontopRepoDirective($uibModal, RepositoriesRestService, toastr, Upload, $translate) {\n return {\n restrict: 'E',\n scope: false,\n templateUrl: 'js/angular/repositories/templates/ontop-repo.html',\n\n link: linkFunc\n };\n\n function linkFunc($scope) {\n $scope.ontopProperiesLink = ONTOP_PROPERTIES_LINK;\n $scope.selectedDriver = {\n driverType: \"generic\",\n driverName: \"Generic JDBC Driver\",\n jdbc: {\n hostName: \"\",\n port: \"\",\n databaseName: \"\",\n userName: \"\",\n password: \"\",\n driverClass: \"\",\n url: \"\"\n },\n urlTemplate: \"\",\n downloadDriverUrl: \"\"\n };\n $scope.ontopRepoFileNames = {};\n $scope.supportedDriversData = [];\n $scope.ontopRepoFileLabels =\n {propertiesFile: 'JDBC properties', obdaFile: 'OBDA or R2RML', owlFile: 'ontology file',\n constraintFile: 'constraint file', lensesFile: 'lenses file', dbMetadataFile: 'DB metadata file'};\n $scope.ontopRepoFiles = Object.keys($scope.ontopRepoFileLabels);\n $scope.ontopRepoFiles.forEach(function(key) {\n if ($scope.repositoryInfo.params[key]) {\n $scope.ontopRepoFileNames[key] = getFileName($scope.repositoryInfo.params[key].value);\n }\n });\n $scope.supportedDriverLabels = {hostName: 'Hostname', port: \"Port\", databaseName: 'Database name',\n userName: 'Username', password: 'Password', driverClass: 'Driver class', url: 'URL'};\n $scope.propertiesFileParams = Object.keys($scope.supportedDriverLabels);\n $scope.classAvailable = false;\n $scope.genericDriverType = 'generic';\n $scope.propertiesFile = 'propertiesFile';\n\n const REQUIRED_ONTOP_REPO_PARAMS = [$scope.propertiesFile, 'obdaFile'];\n const REQUIRED_PROPERTIES_FIELD_PARAMS = ['hostName', 'databaseName', 'userName'];\n\n function getSupportedDriversData() {\n return RepositoriesRestService.getSupportedDriversData($scope.repositoryInfo)\n .success(function (response) {\n $scope.supportedDriversData = response;\n }).error(function (response) {\n showErrorMsg($translate.instant('common.error'), response);\n });\n }\n\n $scope.loadDriverByClass = function (driverClass) {\n const foundDriver = $scope.supportedDriversData\n .find((driver) => driver.driverClass === driverClass);\n if (foundDriver) {\n $scope.copyDriverProperties(foundDriver);\n }\n return foundDriver;\n };\n\n $scope.selectDriverByType = function (driverType) {\n $scope.constructCustomFiledForDriver(driverType);\n\n $scope.copyDriverProperties($scope.supportedDriversData\n .find((driver) => driver.driverType === driverType));\n // Call concatURL with proper labelName to apply changes to url field\n $scope.concatURL('hostName', $scope);\n };\n\n $scope.constructCustomFiledForDriver = function (driver) {\n $scope.supportedDriverLabels.databaseName = 'Database name';\n $scope.supportedDriverLabels.hostName = 'Hostname';\n switch (driver) {\n case 'snowflake':\n $scope.supportedDriverLabels.hostName = 'Account identifier';\n $scope.supportedDriverLabels.databaseName = 'Warehouse';\n break;\n case 'databricks':\n $scope.supportedDriverLabels.databaseName = 'HttpPath';\n break;\n case 'dremio':\n $scope.supportedDriverLabels.databaseName = 'Schema';\n break;\n }\n };\n\n $scope.copyDriverProperties = function (driver) {\n $scope.selectedDriver.driverType = driver.driverType;\n $scope.selectedDriver.jdbc.driverClass = driver.driverClass;\n $scope.selectedDriver.jdbc.url = driver.urlTemplate;\n $scope.selectedDriver.urlTemplate = driver.urlTemplate;\n $scope.selectedDriver.downloadDriverUrl = driver.downloadDriverUrl;\n $scope.selectedDriver.portRequired = driver.portRequired;\n $scope.classAvailable = driver.classAvailable;\n };\n\n $scope.isReadOnly = function (labelName) {\n return labelName === 'driverClass' || labelName === 'url';\n };\n\n $scope.editFile = function(file) {\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/templates/modal/editRepoFile.html',\n controller: 'EditRepositoryFileCtrl',\n resolve: {\n file: function () {\n return $scope.repositoryInfo.params[file] ? $scope.repositoryInfo.params[file].value : '';\n }\n }\n });\n\n modalInstance.result.then(function (data) {\n // send data to backend\n RepositoriesRestService.updateRepositoryFileContent(data.fileLocation, data.content, $scope.repositoryInfo.location).success(function(result) {\n $scope.ontopRepoFileNames[file] = getFileName(result.fileLocation);\n $scope.repositoryInfo.params[file].value = result.fileLocation;\n }).error(function (error) {\n showErrorMsg($translate.instant('common.error'), error);\n })\n });\n }\n\n $scope.uploadOntopRepoFile = function(files, param) {\n if (files && files.length) {\n $scope.uploadFile = files[0];\n $scope.uploadFileLoader = true;\n Upload.upload({\n url: 'rest/repositories/file/upload',\n data: {file: $scope.uploadFile, location: $scope.repositoryInfo.location}\n })\n .success(function (data) {\n if (!data.success) {\n toastr.error(data.errorMessage);\n } else {\n $scope.ontopRepoFileNames[param] = $scope.uploadFile.name;\n $scope.repositoryInfo.params[param].value = data.fileLocation;\n }\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFile = '';\n $scope.uploadFileLoader = false;\n });\n }\n }\n\n $scope.concatURL = function(labelName) {\n if (labelName === 'hostName' || labelName === 'port' || labelName === 'databaseName') {\n let result = $scope.selectedDriver.urlTemplate;\n if ($scope.selectedDriver.jdbc.hostName) {\n if ($scope.selectedDriver.jdbc.port) {\n result = result.replace('{hostport}',\n `${$scope.selectedDriver.jdbc.hostName}:${$scope.selectedDriver.jdbc.port}`);\n } else {\n result = result.replace('{hostport}', $scope.selectedDriver.jdbc.hostName);\n }\n }\n\n if ($scope.selectedDriver.jdbc.databaseName) {\n result = result.replace('{database}', $scope.selectedDriver.jdbc.databaseName);\n }\n\n $scope.selectedDriver.jdbc.url = result;\n }\n }\n\n $scope.getInputType = function (labelName) {\n switch (labelName) {\n case 'password':\n return 'password';\n case 'port':\n return 'number';\n default:\n return 'text';\n }\n }\n\n $scope.checkForRequiredOntopFiles = function () {\n // Should guarantee that code will be executed in sequential manner,\n // because properties file is not created yet\n return updateProperties()\n .then(function () {\n const missingRequired = REQUIRED_ONTOP_REPO_PARAMS.filter(function (requiredFile) {\n return !$scope.repositoryInfo.params[requiredFile].value;\n });\n if (missingRequired.length > 0) {\n toastr.error($translate.instant('ontop.repo.missing.required.file.error'));\n return Promise.reject($translate.instant('ontop.repo.missing.required.file.error'));\n }\n return Promise.resolve();\n });\n }\n\n function loadPropertiesFile() {\n RepositoriesRestService.loadPropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.repositoryInfo.location)\n .success(function (driverData) {\n const driver = $scope.loadDriverByClass(driverData.driverClass);\n // If driver class is not found means that the selected driver is a GENERIC ONE\n if (driver) {\n $scope.selectedDriver.jdbc.hostName = driverData.hostName;\n $scope.selectedDriver.jdbc.port = parseInt(driverData.port);\n $scope.selectedDriver.jdbc.databaseName = driverData.databaseName;\n $scope.selectedDriver.jdbc.userName = driverData.userName;\n $scope.selectedDriver.jdbc.password = driverData.password;\n $scope.selectedDriver.jdbc.url = driverData.url;\n }\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.validateOntopPropertiesConnection = function () {\n updateProperties()\n .then(function () {\n RepositoriesRestService.validateOntopPropertiesConnection($scope.repositoryInfo)\n .success(function () {\n toastr.success($translate.instant('ontop.repo.successful.connection.msg'));\n }).error(function (data) {\n showErrorMsg($translate.instant('ontop.repo.failed.to.connect'), data);\n });\n });\n }\n\n $scope.isOntopRepoFileUploaded = function() {\n return $scope.repositoryInfo.params.propertiesFile &&\n $scope.repositoryInfo.params.propertiesFile.value.length > 0\n };\n\n function missingRequiredField() {\n const missing = REQUIRED_PROPERTIES_FIELD_PARAMS\n .filter(function (requiredField) {\n return !$scope.selectedDriver.jdbc[requiredField]\n });\n if (missing.length > 0) {\n toastr.error($translate.instant('missing.required.field.error'));\n return true;\n }\n return false;\n }\n\n function updateProperties() {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (missingRequiredField()) {\n return Promise.reject($translate.instant('missing.required.field.error'));\n }\n return updatePropertiesFile();\n }\n return Promise.resolve();\n }\n\n function updatePropertiesFile() {\n $scope.uploadFileLoader = true;\n return RepositoriesRestService\n .updatePropertiesFile($scope.repositoryInfo.params[$scope.propertiesFile].value, $scope.selectedDriver.jdbc, $scope.repositoryInfo.location)\n .success(function (data) {\n $scope.ontopRepoFileNames[$scope.propertiesFile] = getFileName(data.fileLocation);\n $scope.repositoryInfo.params[$scope.propertiesFile].value = data.fileLocation;\n $scope.uploadFileLoader = false;\n }).error(function (data) {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFileLoader = false;\n });\n }\n\n $scope.isRequiredOntopRepoFile = function(file) {\n return REQUIRED_ONTOP_REPO_PARAMS.indexOf(file) > -1;\n };\n\n $scope.isRequiredField = function (field) {\n return REQUIRED_PROPERTIES_FIELD_PARAMS.indexOf(field) > -1\n || field === 'port' && $scope.selectedDriver.portRequired;\n };\n\n $scope.getFieldTooltip = function (field) {\n if (field === 'port' && $scope.selectedDriver.portRequired) {\n field = 'portIfRequired';\n }\n return $translate.instant('repoTooltips.ontop.' + field);\n };\n\n $scope.editOntopRepo = function () {\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.editRepository();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n }\n\n $scope.createOntopRepo = function () {\n if (!$scope.repositoryInfo.id) {\n toastr.error($translate.instant('empty.repoid.warning'));\n return;\n }\n\n $scope.checkForRequiredOntopFiles()\n .then(function () {\n $scope.createRepo();\n }).catch(function (err) {\n // The catch block is empty, because error is handled in promise\n });\n };\n\n $scope.goBackToPrevious = function () {\n $scope.goBackToPreviousLocation();\n }\n\n function showErrorMsg (title, data) {\n const msg = getError(data);\n toastr.error(msg, title);\n }\n\n getSupportedDriversData()\n .then(function () {\n if ($scope.editRepoPage) {\n loadPropertiesFile();\n }\n });\n }\n}\n"],"sourceRoot":""}