graphdb-workbench 2.3.0-TR13 → 2.3.0-TR14

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 (60) hide show
  1. package/dist/{108.48d356705148824d9fa5.bundle.js → 108.2a3cf65810651d09177e.bundle.js} +2 -2
  2. package/dist/108.2a3cf65810651d09177e.bundle.js.map +1 -0
  3. package/dist/11.a7e4833dee726968779b.bundle.js +1 -1
  4. package/dist/11.a7e4833dee726968779b.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/{172.8b5bc91c1b15909a0ce4.bundle.js → 172.d80696724520505a794d.bundle.js} +2 -2
  8. package/dist/{172.8b5bc91c1b15909a0ce4.bundle.js.map → 172.d80696724520505a794d.bundle.js.map} +1 -1
  9. package/dist/20.4eb25ede434dc329ecf1.bundle.js +1 -1
  10. package/dist/20.4eb25ede434dc329ecf1.bundle.js.map +1 -1
  11. package/dist/21.07350ccc2e95126b165e.bundle.js +2 -0
  12. package/dist/21.07350ccc2e95126b165e.bundle.js.map +1 -0
  13. package/dist/27.fef157d9275358c9f1a0.bundle.js +1 -1
  14. package/dist/27.fef157d9275358c9f1a0.bundle.js.map +1 -1
  15. package/dist/33.fde8076c81c87c25c367.bundle.js +1 -1
  16. package/dist/33.fde8076c81c87c25c367.bundle.js.map +1 -1
  17. package/dist/40.10f42e3f6d8d87bd3221.bundle.js +1 -1
  18. package/dist/40.10f42e3f6d8d87bd3221.bundle.js.map +1 -1
  19. package/dist/94.94158487a9024ff3a623.bundle.js +1 -1
  20. package/dist/94.94158487a9024ff3a623.bundle.js.map +1 -1
  21. package/dist/{bundle.dacee83de90b0e3091da.bundle.js → bundle.fb5d69798d676122d4e6.bundle.js} +3 -3
  22. package/dist/{bundle.dacee83de90b0e3091da.bundle.js.map → bundle.fb5d69798d676122d4e6.bundle.js.map} +1 -1
  23. package/dist/i18n/locale-en.json +5 -0
  24. package/dist/i18n/locale-fr.json +5 -0
  25. package/dist/index.html +3 -3
  26. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  27. package/dist/js/angular/repositories/templates/ontop-repo.html +2 -2
  28. package/dist/license-checker.json +2 -2
  29. package/dist/pages/autocomplete.html +1 -1
  30. package/dist/pages/choose-repository-type.html +1 -1
  31. package/dist/pages/cluster-management/clusterInfo.html +3 -3
  32. package/dist/pages/create-index.html +4 -4
  33. package/dist/pages/dependencies.html +1 -1
  34. package/dist/pages/domainRangeInfo.html +2 -2
  35. package/dist/pages/edit.html +1 -1
  36. package/dist/pages/explore.html +1 -1
  37. package/dist/pages/export.html +1 -1
  38. package/dist/pages/find.html +1 -1
  39. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  40. package/dist/pages/graphs-visualizations.html +7 -7
  41. package/dist/pages/guides.html +1 -1
  42. package/dist/pages/import.html +1 -1
  43. package/dist/pages/jdbc-create.html +5 -5
  44. package/dist/pages/monitor/queries.html +1 -1
  45. package/dist/pages/monitor/resources.html +2 -2
  46. package/dist/pages/namespaces.html +2 -2
  47. package/dist/pages/plugins.html +1 -1
  48. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  49. package/dist/pages/rdfrank.html +2 -2
  50. package/dist/pages/repositories.html +2 -2
  51. package/dist/pages/repository.html +2 -2
  52. package/dist/pages/similarity-indexes.html +1 -1
  53. package/dist/pages/sparql-template-create.html +5 -5
  54. package/dist/pages/sparql.html +3 -3
  55. package/dist/pages/webapi.html +2 -2
  56. package/dist/res/swagger/index.html +27 -27
  57. package/package.json +1 -1
  58. package/dist/108.48d356705148824d9fa5.bundle.js.map +0 -1
  59. package/dist/21.45b691e4f5bf3f075855.bundle.js +0 -2
  60. package/dist/21.45b691e4f5bf3f075855.bundle.js.map +0 -1
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[108],{106:function(e,t,o){"use strict";o.r(t);var r=o(66);const a={OBDA:"obdaFile",OWL:"owlFile",CONSTRAINT:"constraintFile",LENSES:"lensesFile",DB_METADATA:"dbMetadataFile"};class n{constructor(e="generic"){this.driverType=e,this.hostName="",this.port=void 0,this.databaseName="",this.username="",this.password="",this.driverClass="",this.url="",this.urlUserInput=""}}class i{constructor(e,t=!1){this.type=e,this.fileName="",this.loading=!1,this.required=t}}class s extends Error{}class p{constructor(){this.classAvailable=!1,this.downloadDriverUrl="",this.driverClass="",this.driverName="",this.driverType="",this.portRequired=!1,this.urlTemplate=""}}function l(e,t,o,l,c){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(d){d.genericDriverType="generic",d.defaultUrlTemplate="jdbc:database://localhost:port/database_name",d.ontopProperiesLink="https://ontop-vkg.org/guide/advanced/configuration.html",d.ontopFileType=a,d.selectedDriver=new p,d.supportedDriversData=[],d.formData={connectionInformation:new n,settings:{additionalProperties:"",ontopFiles:[]}},d.selectDriver=e=>{d.selectedDriver=d.supportedDriversData.find(t=>t.driverType===e),d.editRepoPage&&d.currentOntopRepoInfo&&d.currentOntopRepoInfo.connectionInformation.driverType===e?d.formData=angular.copy(d.currentOntopRepoInfo):(T(),d.formData.connectionInformation.driverType=d.selectedDriver.driverType),d.formData.connectionInformation.driverClass=d.selectedDriver.driverClass,d.updateUrl()},d.getOntopFileInfo=e=>d.formData.settings.ontopFiles.find(t=>e===t.type),d.getHostNameLabel=()=>{const e="snowflake"===d.selectedDriver.driverType?"ontop.repo.database.snowflake.host_name":"ontop.repo.database.host_name";return c.instant(e)+"*"},d.getDatabaseNameLabel=()=>{let e="";switch(d.selectedDriver.driverType){case"snowflake":e="ontop.repo.database.warehouse.database_name";break;case"databricks":e="ontop.repo.database.http_path.database_name";break;case"dremio":e="ontop.repo.database.schema.database_name";break;default:e="ontop.repo.database.database_name"}return c.instant(e)},d.updateUrl=()=>{const e=f()||"";d.formData.connectionInformation.url=e+d.formData.connectionInformation.urlUserInput},d.isTestConnectionDisabled=()=>{const e=d.formData.connectionInformation,t=d.selectedDriver;return!(e.driverClass&&e.url&&(!t.portRequired||e.port))||!(t.driverType===d.genericDriverType||e.hostName&&e.databaseName)},d.testConnection=()=>{h().then(w).then(g).then(I).then(y).then(v).then(()=>t.validateOntopPropertiesConnection(d.repositoryInfo)).then(()=>o.success(c.instant("ontop.repo.successful.connection.msg"))).catch(e=>{e instanceof s?o.error(e.message):D(c.instant("ontop.repo.failed.to.connect"),e)})},d.editFile=o=>{const a=d.repositoryInfo.params[o.type].label,n=c.instant("update.file.edit.content.header",{fileName:a});e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",windowClass:"update-ontop-repo-dialog",resolve:{file:()=>{const e=d.repositoryInfo.params[o.type];return e?e.value:""},dialogTitle:()=>n}}).result.then(e=>{t.updateRepositoryFileContent(e.fileLocation,e.content,d.repositoryInfo.location).success(e=>{o.fileName=Object(r.getFileName)(e.fileLocation),d.repositoryInfo.params[o.type].value=e.fileLocation}).error(e=>{D(c.instant("common.error"),e)})})},d.uploadOntopFile=(e,t)=>{if(e&&e.length){const r=e[0];t.loading=!0;const a={url:"rest/repositories/file/upload",data:{file:r,location:d.repositoryInfo.location}};l.upload(a).success(e=>{e.success?(t.fileName=r.name,d.repositoryInfo.params[t.type].value=e.fileLocation):o.error(e.errorMessage)}).error(e=>{D(c.instant("common.error"),e),d.uploadFile=""}).finally(()=>{t.loading=!1})}},d.updateOntopRepo=()=>{const e=d.editRepoPage?d.editRepository:d.createRepo;b().then(h).then(w).then(g).then(I).then(y).then(N).then(v).then(e).catch(e=>{e instanceof s?o.error(e.message):console.log(e)})},d.onKeyDownInUrlInput=e=>{const t=e.keyCode;if(37===t||39===t||36===t||35===t)return;const o=f();if(!o)return;const r=e.ctrlKey||e.metaKey;if(r&&65===t||r&&67===t)return;const a=e.target.selectionStart;8===t&&a-1<o.length&&(e.preventDefault(),e.stopPropagation()),a<o.length&&(e.preventDefault(),e.stopPropagation())},d.onKeyUpInUrlInput=()=>{m()};const m=()=>{const e=f();e&&d.formData.connectionInformation.url.startsWith(e)?d.formData.connectionInformation.urlUserInput=d.formData.connectionInformation.url.substring(e.length):d.formData.connectionInformation.urlUserInput=d.formData.connectionInformation.url},f=()=>{let e=d.selectedDriver.urlTemplate;const t=d.formData.connectionInformation;return t.hostName&&(e=t.port?e.replace("{hostport}",`${t.hostName}:${t.port}`):e.replace("{hostport}",""+t.hostName)),t.databaseName&&(e=e.replace("{database}",t.databaseName)),e},u=e=>{d.formData.settings.ontopFiles.forEach(t=>{t.loading=e})},v=()=>{u(!0);const e=d.formData.connectionInformation,o={hostName:e.hostName,port:e.port,databaseName:e.databaseName,userName:e.username,password:e.password,driverClass:e.driverClass,url:e.url,additionalProperties:d.formData.settings.additionalProperties};return t.updatePropertiesFile(d.repositoryInfo.params.propertiesFile.value,o,d.repositoryInfo.location,d.selectedDriver.driverType).success(e=>{d.repositoryInfo.params.propertiesFile.value=e.fileLocation}).error(e=>{D(c.instant("common.error"),e)}).finally(()=>u(!1))},D=(e,t)=>{const r=getError(t);o.error(r,e)},h=()=>d.selectedDriver.driverType===d.genericDriverType||d.formData.connectionInformation.hostName?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.host_name")}))),g=()=>d.selectedDriver.driverType===d.genericDriverType||d.formData.connectionInformation.databaseName?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.database_name")}))),I=()=>d.formData.connectionInformation.driverClass?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.driver_class")}))),y=()=>d.formData.connectionInformation.url?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.url")}))),b=()=>d.repositoryInfo.id?Promise.resolve():Promise.reject(new s(c.instant("empty.repoid.warning"))),N=()=>d.getOntopFileInfo(a.OBDA).fileName?Promise.resolve():Promise.reject(new s(c.instant("ontop.repo.missing.required.file",{fileName:d.repositoryInfo.params[a.OBDA].label}))),w=()=>d.selectedDriver.portRequired&&!d.formData.connectionInformation.port?Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.port")}))):Promise.resolve(),T=()=>{d.formData={connectionInformation:new n,settings:{additionalProperties:"",ontopFiles:[]}},Object.values(a).forEach(e=>{const t=new i(e);d.formData.settings.ontopFiles.push(t)}),d.getOntopFileInfo(a.OBDA).required=!0};t.getSupportedDriversData(d.repositoryInfo).success(e=>{d.supportedDriversData=e}).error(e=>{D(c.instant("common.error"),e)}).then(()=>{d.editRepoPage?(u(!0),t.loadPropertiesFile(d.repositoryInfo.params.propertiesFile.value,d.repositoryInfo.location,d.selectedDriver.driverType).success(e=>{let t=d.supportedDriversData.find(t=>t.driverClass===e.driverClass);t||(t=d.supportedDriversData.find(e=>d.genericDriverType===e.driverType)),d.selectDriver(t.driverType),d.formData.connectionInformation.driverType=t.driverType,d.formData.connectionInformation.databaseName=e.databaseName,d.formData.connectionInformation.driverClass=e.driverClass,d.formData.connectionInformation.hostName=e.hostName,d.formData.connectionInformation.password=e.password,d.formData.connectionInformation.port=e.port?parseInt(e.port,10):void 0,d.formData.connectionInformation.username=e.userName,d.formData.connectionInformation.url=e.url,d.formData.settings.additionalProperties=e.additionalProperties,m(),d.updateUrl(),Object.values(a).forEach(e=>{const t=d.repositoryInfo.params[e],o=d.getOntopFileInfo(e);t&&(o.fileName=Object(r.getFileName)(t.value))}),d.currentOntopRepoInfo=angular.copy(d.formData)}).error(e=>{D(c.instant("common.error"),e)}).finally(()=>{u(!1)})):d.selectDriver(d.genericDriverType)})}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",l),l.$inject=["$uibModal","RepositoriesRestService","toastr","Upload","$translate"]}}]);
2
- //# sourceMappingURL=108.48d356705148824d9fa5.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[108],{106:function(e,t,o){"use strict";o.r(t);var r=o(66);const a={OBDA:"obdaFile",OWL:"owlFile",CONSTRAINT:"constraintFile",LENSES:"lensesFile",DB_METADATA:"dbMetadataFile"};class n{constructor(e="generic"){this.driverType=e,this.hostName="",this.port=void 0,this.databaseName="",this.username="",this.password="",this.driverClass="",this.url="",this.urlUserInput=""}}class i{constructor(e,t=!1){this.type=e,this.fileName="",this.loading=!1,this.required=t}}class s extends Error{}class p{constructor(){this.classAvailable=!1,this.downloadDriverUrl="",this.driverClass="",this.driverName="",this.driverType="",this.portRequired=!1,this.urlTemplate=""}}function l(e,t,o,l,c){return{restrict:"E",scope:!1,templateUrl:"js/angular/repositories/templates/ontop-repo.html",link:function(d){d.genericDriverType="generic",d.defaultUrlTemplate="jdbc:database://localhost:port/database_name",d.ontopProperiesLink="https://ontop-vkg.org/guide/advanced/configuration.html",d.ontopFileType=a,d.selectedDriver=new p,d.supportedDriversData=[],d.formData={connectionInformation:new n,settings:{additionalProperties:"",ontopFiles:[]}},d.selectDriver=e=>{d.selectedDriver=d.supportedDriversData.find(t=>t.driverType===e),d.editRepoPage&&d.currentOntopRepoInfo&&d.currentOntopRepoInfo.connectionInformation.driverType===e?d.formData=angular.copy(d.currentOntopRepoInfo):(w(),d.formData.connectionInformation.driverType=d.selectedDriver.driverType),d.formData.connectionInformation.driverClass=d.selectedDriver.driverClass,d.updateUrl()},d.getOntopFileInfo=e=>d.formData.settings.ontopFiles.find(t=>e===t.type),d.getHostNameLabel=()=>{const e="snowflake"===d.selectedDriver.driverType?"ontop.repo.database.snowflake.host_name":"ontop.repo.database.host_name";return c.instant(e)+"*"},d.getDatabaseNameLabel=()=>{let e="";switch(d.selectedDriver.driverType){case"snowflake":e="ontop.repo.database.warehouse.database_name";break;case"databricks":e="ontop.repo.database.http_path.database_name";break;case"dremio":e="ontop.repo.database.schema.database_name";break;default:e="ontop.repo.database.database_name"}return c.instant(e)},d.updateUrl=()=>{const e=f()||"";d.formData.connectionInformation.url=e+d.formData.connectionInformation.urlUserInput},d.isTestConnectionDisabled=()=>{const e=d.formData.connectionInformation,t=d.selectedDriver;return!(e.driverClass&&e.url&&(!t.portRequired||e.port))||!(t.driverType===d.genericDriverType||e.hostName&&e.databaseName)},d.testConnection=()=>{h().then(T).then(g).then(y).then(I).then(v).then(()=>t.validateOntopPropertiesConnection(d.repositoryInfo)).then(()=>o.success(c.instant("ontop.repo.successful.connection.msg"))).catch(e=>{e instanceof s?o.error(e.message):D(c.instant("ontop.repo.failed.to.connect"),e)})},d.editFile=o=>{const a=d.repositoryInfo.params[o.type].label,n=c.instant("update.file.edit.content.header",{fileName:a});e.open({templateUrl:"js/angular/templates/modal/editRepoFile.html",controller:"EditRepositoryFileCtrl",windowClass:"update-ontop-repo-dialog",resolve:{file:()=>{const e=d.repositoryInfo.params[o.type];return e?e.value:""},dialogTitle:()=>n}}).result.then(e=>{t.updateRepositoryFileContent(e.fileLocation,e.content,d.repositoryInfo.location).success(e=>{o.fileName=Object(r.getFileName)(e.fileLocation),d.repositoryInfo.params[o.type].value=e.fileLocation}).error(e=>{D(c.instant("common.error"),e)})})},d.uploadOntopFile=(e,t)=>{if(e&&e.length){const r=e[0];t.loading=!0;const a={url:"rest/repositories/file/upload",data:{file:r,location:d.repositoryInfo.location}};l.upload(a).success(e=>{e.success?(t.fileName=r.name,d.repositoryInfo.params[t.type].value=e.fileLocation):o.error(e.errorMessage)}).error(e=>{D(c.instant("common.error"),e),d.uploadFile=""}).finally(()=>{t.loading=!1})}},d.updateOntopRepo=()=>{const e=d.editRepoPage?d.editRepository:d.createRepo;b().then(h).then(T).then(g).then(y).then(I).then(N).then(v).then(e).catch(e=>{e instanceof s?o.error(e.message):console.log(e)})},d.onKeyDownInUrlInput=e=>{const t=e.keyCode;if(37===t||39===t||36===t||35===t)return;const o=f();if(!o)return;const r=e.ctrlKey||e.metaKey;if(r&&65===t||r&&67===t)return;const a=e.target.selectionStart;8===t&&a-1<o.length&&(e.preventDefault(),e.stopPropagation()),a<o.length&&(e.preventDefault(),e.stopPropagation())},d.onKeyUpInUrlInput=()=>{m()};const m=()=>{const e=f();e&&d.formData.connectionInformation.url.startsWith(e)?d.formData.connectionInformation.urlUserInput=d.formData.connectionInformation.url.substring(e.length):d.formData.connectionInformation.urlUserInput=d.formData.connectionInformation.url},f=()=>{let e=d.selectedDriver.urlTemplate;const t=d.formData.connectionInformation;return t.hostName&&(e=t.port?e.replace("{hostport}",`${t.hostName}:${t.port}`):e.replace("{hostport}",""+t.hostName)),t.databaseName&&(e=e.replace("{database}",t.databaseName)),e},u=e=>{d.formData.settings.ontopFiles.forEach(t=>{t.loading=e})},v=()=>{u(!0);const e=d.formData.connectionInformation,o={hostName:e.hostName,port:e.port,databaseName:e.databaseName,userName:e.username,password:e.password,driverClass:e.driverClass,url:e.url,additionalProperties:d.formData.settings.additionalProperties};return t.updatePropertiesFile(d.repositoryInfo.params.propertiesFile.value,o,d.repositoryInfo.location,d.selectedDriver.driverType).success(e=>{d.repositoryInfo.params.propertiesFile.value=e.fileLocation}).error(e=>{D(c.instant("common.error"),e)}).finally(()=>u(!1))},D=(e,t)=>{const r=getError(t);o.error(r,e)},h=()=>d.selectedDriver.driverType===d.genericDriverType||d.formData.connectionInformation.hostName?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.host_name")}))),g=()=>d.selectedDriver.driverType===d.genericDriverType||d.formData.connectionInformation.databaseName?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.database_name")}))),y=()=>d.formData.connectionInformation.driverClass?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.driver_class")}))),I=()=>d.formData.connectionInformation.url?Promise.resolve():Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.url")}))),b=()=>d.repositoryInfo.id?Promise.resolve():Promise.reject(new s(c.instant("empty.repoid.warning"))),N=()=>d.getOntopFileInfo(a.OBDA).fileName?Promise.resolve():Promise.reject(new s(c.instant("ontop.repo.missing.required.file",{fileName:d.repositoryInfo.params[a.OBDA].label}))),T=()=>d.selectedDriver.portRequired&&!d.formData.connectionInformation.port?Promise.reject(new s(c.instant("missing.required.field",{fieldName:c.instant("ontop.repo.database.port")}))):Promise.resolve(),w=()=>{d.formData={connectionInformation:new n,settings:{additionalProperties:"",ontopFiles:[]}},Object.values(a).forEach(e=>{const t=new i(e);d.formData.settings.ontopFiles.push(t)}),d.getOntopFileInfo(a.OBDA).required=!0};t.getSupportedDriversData(d.repositoryInfo).success(e=>{d.supportedDriversData=e}).error(e=>{D(c.instant("common.error"),e)}).then(()=>{d.editRepoPage?(u(!0),t.loadPropertiesFile(d.repositoryInfo.params.propertiesFile.value,d.repositoryInfo.location,d.selectedDriver.driverType).success(e=>{let t=d.supportedDriversData.find(t=>t.driverClass===e.driverClass);t&&e.hostName||(t=d.supportedDriversData.find(e=>d.genericDriverType===e.driverType)),d.selectDriver(t.driverType),d.formData.connectionInformation.driverType=t.driverType,d.formData.connectionInformation.driverClass=e.driverClass,d.formData.connectionInformation.password=e.password,d.formData.connectionInformation.username=e.userName,d.formData.connectionInformation.url=e.url,d.formData.settings.additionalProperties=e.additionalProperties,d.genericDriverType!==t.driverType&&(d.formData.connectionInformation.hostName=e.hostName,d.formData.connectionInformation.databaseName=e.databaseName,d.formData.connectionInformation.port=e.port?parseInt(e.port,10):void 0),m(),d.updateUrl(),Object.values(a).forEach(e=>{const t=d.repositoryInfo.params[e],o=d.getOntopFileInfo(e);t&&(o.fileName=Object(r.getFileName)(t.value))}),d.currentOntopRepoInfo=angular.copy(d.formData)}).error(e=>{D(c.instant("common.error"),e)}).finally(()=>{u(!1)})):d.selectDriver(d.genericDriverType)})}}}angular.module("graphdb.framework.repositories.ontop-repo.directive",[]).directive("ontopRepo",l),l.$inject=["$uibModal","RepositoriesRestService","toastr","Upload","$translate"]}}]);
2
+ //# sourceMappingURL=108.2a3cf65810651d09177e.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///./src/models/ontop/ontop-file-type.js","webpack:///./src/models/ontop/ontop-connection-information.js","webpack:///./src/models/ontop/ontop-file-info.js","webpack:///./src/models/ontop/ontop-repository-error.js","webpack:///./src/models/ontop/ontop-driver-data.js","webpack:///./src/js/angular/repositories/ontop-repo.directive.js"],"names":["OntopFileType","OntopConnectionInformation","driverType","this","hostName","port","undefined","databaseName","username","password","driverClass","url","urlUserInput","OntopFileInfo","type","required","fileName","loading","OntopRepositoryError","Error","OntopDriverData","classAvailable","downloadDriverUrl","driverName","portRequired","urlTemplate","ontopRepoDirective","$uibModal","RepositoriesRestService","toastr","Upload","$translate","restrict","scope","templateUrl","link","$scope","genericDriverType","defaultUrlTemplate","ontopProperiesLink","ontopFileType","selectedDriver","supportedDriversData","formData","connectionInformation","settings","additionalProperties","ontopFiles","selectDriver","find","driver","editRepoPage","currentOntopRepoInfo","angular","copy","clearFormData","updateUrl","getOntopFileInfo","ontopFileInfo","getHostNameLabel","hostNameLabel","instant","getDatabaseNameLabel","dataBaseNameLabelKey","calculateTemplateUrl","isTestConnectionDisabled","testConnection","validateHostName","then","validatePort","validateDatabaseName","validateDriverClass","validateUrl","updatePropertiesFile","validateOntopPropertiesConnection","repositoryInfo","success","catch","error","message","showErrorMsg","editFile","params","label","title","open","controller","windowClass","resolve","file","ontopFile","value","dialogTitle","result","data","updateRepositoryFileContent","fileLocation","content","location","uploadOntopFile","files","length","uploadFile","uploadData","upload","name","errorMessage","finally","updateOntopRepo","createOrUpdate","editRepository","createRepo","validateRepositoryId","validateOntopFiles","console","log","onKeyDownInUrlInput","event","keyCode","ctrlDown","ctrlKey","metaKey","cursorPosition","target","selectionStart","preventDefault","stopPropagation","onKeyUpInUrlInput","extractExtraUrl","startsWith","substring","replace","setLoading","forEach","jdbc","userName","propertiesFile","msg","getError","Promise","reject","fieldName","id","OBDA","Object","values","push","getSupportedDriversData","response","loadPropertiesFile","driverData","parseInt","module","directive","$inject"],"mappings":"+GAA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EAAOY,aAAaZ,EAAOC,uBAze/CgB,QACKmG,OAAO,sDAAuD,IAC9DC,UAAU,YAAa/H,GAE5BA,EAAmBgI,QAAU,CAAC,YAAa,0BAA2B,SAAU,SAAU","file":"108.2a3cf65810651d09177e.bundle.js","sourcesContent":["export const OntopFileType = {\n 'OBDA': 'obdaFile',\n 'OWL': 'owlFile',\n 'CONSTRAINT': 'constraintFile',\n 'LENSES': 'lensesFile',\n 'DB_METADATA': 'dbMetadataFile'\n};\n","export class OntopConnectionInformation {\n constructor(driverType = 'generic') {\n this.driverType = driverType;\n this.hostName = '';\n this.port = undefined;\n this.databaseName = '';\n this.username = '';\n this.password = '';\n this.driverClass = '';\n this.url = '';\n this.urlUserInput = '';\n }\n}\n","export class OntopFileInfo {\n\n /**\n * Initializes ontop file info object.\n * @param {string} type - the type of ontop file. It's value have to be one of {@link OntopFileType};\n * @param {boolean} required - true if file is required.\n */\n constructor(type, required = false) {\n this.type = type;\n this.fileName = '';\n this.loading = false;\n this.required = required;\n }\n}\n","export class OntopRepositoryError extends Error {\n}\n","export class OntopDriverData {\n constructor() {\n this.classAvailable = false;\n this.downloadDriverUrl = '';\n this.driverClass = '';\n this.driverName = '';\n this.driverType = '';\n this.portRequired = false;\n this.urlTemplate = '';\n }\n}\n","import {getFileName} from \"./controllers\";\nimport {OntopFileType} from \"../../../models/ontop/ontop-file-type\";\nimport {OntopConnectionInformation} from \"../../../models/ontop/ontop-connection-information\";\nimport {OntopFileInfo} from \"../../../models/ontop/ontop-file-info\";\nimport {OntopRepositoryError} from \"../../../models/ontop/ontop-repository-error\";\nimport {OntopDriverData} from \"../../../models/ontop/ontop-driver-data\";\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 const HOME_KEY = 36;\n const END_KEY = 35;\n const LEFT_ARROW = 37;\n const RIGHT_ARROW = 39;\n const BACKSPACE = 8;\n const KEY_C = 67;\n const KEY_A = 65;\n $scope.genericDriverType = 'generic';\n $scope.defaultUrlTemplate = 'jdbc:database://localhost:port/database_name';\n $scope.ontopProperiesLink = ONTOP_PROPERTIES_LINK;\n $scope.ontopFileType = OntopFileType;\n\n /**\n * Holds reference to selected driver.\n *\n * @type {OntopDriverData}\n */\n $scope.selectedDriver = new OntopDriverData();\n\n /**\n * Holds all supported jdbc drivers.\n * @type {OntopDriverData[]}\n */\n $scope.supportedDriversData = [];\n $scope.formData = {\n connectionInformation: new OntopConnectionInformation(),\n settings: {\n additionalProperties: '',\n /**\n * Holds information about repository files.\n */\n ontopFiles: []\n }\n };\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Changes selected driver and updates url field.\n * @param {string} driverType - the type of driver.\n */\n $scope.selectDriver = (driverType) => {\n $scope.selectedDriver = $scope.supportedDriversData.find((driver) => driver.driverType === driverType);\n if ($scope.editRepoPage && $scope.currentOntopRepoInfo && $scope.currentOntopRepoInfo.connectionInformation.driverType === driverType) {\n $scope.formData = angular.copy($scope.currentOntopRepoInfo);\n } else {\n clearFormData();\n $scope.formData.connectionInformation.driverType = $scope.selectedDriver.driverType;\n }\n $scope.formData.connectionInformation.driverClass = $scope.selectedDriver.driverClass;\n $scope.updateUrl();\n };\n\n /**\n * Finds ontop file depends on file type <code>ontopFileType</code>\n * @param {OntopFileType} ontopFileType - the type of searched ontop file.\n * @return {OntopFileInfo} found ontop file.\n */\n $scope.getOntopFileInfo = (ontopFileType) => {\n return $scope.formData.settings.ontopFiles.find((ontopFileInfo) => ontopFileType === ontopFileInfo.type);\n };\n\n $scope.getHostNameLabel = () => {\n const hostNameLabel = 'snowflake' === $scope.selectedDriver.driverType ? 'ontop.repo.database.snowflake.host_name' : 'ontop.repo.database.host_name';\n return $translate.instant(hostNameLabel) + '*';\n };\n\n $scope.getDatabaseNameLabel = () => {\n let dataBaseNameLabelKey = '';\n switch ($scope.selectedDriver.driverType) {\n case 'snowflake':\n dataBaseNameLabelKey = 'ontop.repo.database.warehouse.database_name';\n break;\n case 'databricks':\n dataBaseNameLabelKey = 'ontop.repo.database.http_path.database_name';\n break;\n case 'dremio':\n dataBaseNameLabelKey = 'ontop.repo.database.schema.database_name';\n break;\n default:\n dataBaseNameLabelKey = 'ontop.repo.database.database_name';\n }\n return $translate.instant(dataBaseNameLabelKey);\n };\n\n /**\n * Updates value of <code>$scope.formData.connectionInformation.url</code> depends on other connection information: Host name, Port...\n */\n $scope.updateUrl = () => {\n const templateUrl = calculateTemplateUrl() || '';\n $scope.formData.connectionInformation.url = templateUrl + $scope.formData.connectionInformation.urlUserInput;\n };\n\n /**\n * Checks if test connection can be executed.\n * @return {boolean} true if all needed data is filled by the user.\n */\n $scope.isTestConnectionDisabled = () => {\n const connectionInformation = $scope.formData.connectionInformation;\n const selectedDriver = $scope.selectedDriver;\n if (!connectionInformation.driverClass || !connectionInformation.url || selectedDriver.portRequired && !connectionInformation.port) {\n return true;\n }\n return selectedDriver.driverType !== $scope.genericDriverType && (!connectionInformation.hostName || !connectionInformation.databaseName);\n };\n\n /**\n * Performs a test connection.\n */\n $scope.testConnection = () => {\n validateHostName()\n .then(validatePort)\n .then(validateDatabaseName)\n .then(validateDriverClass)\n .then(validateUrl)\n .then(updatePropertiesFile)\n .then(() => RepositoriesRestService.validateOntopPropertiesConnection($scope.repositoryInfo))\n .then(() => toastr.success($translate.instant('ontop.repo.successful.connection.msg')))\n .catch((error) => {\n if (error instanceof OntopRepositoryError) {\n toastr.error(error.message);\n } else {\n showErrorMsg($translate.instant('ontop.repo.failed.to.connect'), error);\n }\n });\n };\n\n /**\n * Updates the file with type <code>ontopFileType</code>.\n *\n * @param {OntopFileInfo} ontopFileInfo\n */\n $scope.editFile = (ontopFileInfo) => {\n\n const fileName = $scope.repositoryInfo.params[ontopFileInfo.type].label;\n const title = $translate.instant('update.file.edit.content.header', {fileName});\n const modalInstance = $uibModal.open({\n templateUrl: 'js/angular/templates/modal/editRepoFile.html',\n controller: 'EditRepositoryFileCtrl',\n windowClass: 'update-ontop-repo-dialog',\n resolve: {\n file: () => {\n const ontopFile = $scope.repositoryInfo.params[ontopFileInfo.type];\n return ontopFile ? ontopFile.value : '';\n },\n dialogTitle: () => {\n return title;\n }\n }\n });\n\n modalInstance.result.then((data) => {\n // send data to backend\n RepositoriesRestService.updateRepositoryFileContent(data.fileLocation, data.content, $scope.repositoryInfo.location)\n .success((result) => {\n ontopFileInfo.fileName = getFileName(result.fileLocation);\n $scope.repositoryInfo.params[ontopFileInfo.type].value = result.fileLocation;\n }).error((error) => {\n showErrorMsg($translate.instant('common.error'), error);\n });\n });\n };\n\n $scope.uploadOntopFile = (files, ontopFileInfo) => {\n if (files && files.length) {\n const uploadFile = files[0];\n ontopFileInfo.loading = true;\n const uploadData = {\n url: 'rest/repositories/file/upload',\n data: {file: uploadFile, location: $scope.repositoryInfo.location}\n };\n Upload.upload(uploadData)\n .success((data) => {\n if (!data.success) {\n toastr.error(data.errorMessage);\n } else {\n ontopFileInfo.fileName = uploadFile.name;\n $scope.repositoryInfo.params[ontopFileInfo.type].value = data.fileLocation;\n }\n })\n .error((data) => {\n showErrorMsg($translate.instant('common.error'), data);\n $scope.uploadFile = '';\n })\n .finally(() => {\n ontopFileInfo.loading = false;\n });\n }\n };\n\n $scope.updateOntopRepo = () => {\n const createOrUpdate = $scope.editRepoPage ? $scope.editRepository : $scope.createRepo;\n validateRepositoryId()\n .then(validateHostName)\n .then(validatePort)\n .then(validateDatabaseName)\n .then(validateDriverClass)\n .then(validateUrl)\n .then(validateOntopFiles)\n .then(updatePropertiesFile)\n .then(createOrUpdate)\n .catch((error) => {\n if (error instanceof OntopRepositoryError) {\n toastr.error(error.message);\n } else {\n console.log(error);\n }\n });\n };\n\n /**\n * Some databases expect additional properties than hostname, port, database name in order to establish the connection.\n * So url is not readonly and user can modify it. Every driver instead generic one has template tha can't be changed by the user, it\n * is filled automatically when user writes hostname, port, and database name.\n *\n * This function prevent modification of driver template.\n *\n * @param event - event fired by key down.\n */\n $scope.onKeyDownInUrlInput = (event) => {\n const keyCode = event.keyCode;\n // We don't prevent event if user clicked on left, right arrow, home or end key,\n // the client can move cursor without matter where the cursor is.\n if (keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW || keyCode === HOME_KEY || keyCode === END_KEY) {\n return;\n }\n\n const templateUrl = calculateTemplateUrl();\n // If templateUrl is empty this means that chosen driver is generic or user is not filled hostname, port, or database name.\n // So user can type any characters into url input.\n if (!templateUrl) {\n return;\n }\n\n // Allows user to select all and copy the url value regardless that cursor position is in url template area.\n // event.metaKey -> Mac support\n const ctrlDown = event.ctrlKey || event.metaKey;\n if (ctrlDown && KEY_A === keyCode || ctrlDown && KEY_C === keyCode) {\n return;\n }\n\n const cursorPosition = event.target.selectionStart;\n\n if (keyCode === BACKSPACE && cursorPosition - 1 < templateUrl.length) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n if (cursorPosition < templateUrl.length) {\n // If templateUrl is not empty and cursor is in the middle of it, we will prevent the event and not allow to modify the url.\n event.preventDefault();\n event.stopPropagation();\n }\n\n // If templateUrl is not empty and cursor is after it, the user can write any character into the url input.\n };\n\n $scope.onKeyUpInUrlInput = () => {\n extractExtraUrl();\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Extracts manual user input from url input element.\n */\n const extractExtraUrl = () => {\n const templateUrl = calculateTemplateUrl();\n if (templateUrl) {\n if ($scope.formData.connectionInformation.url.startsWith(templateUrl)) {\n // If templateUrl is not empty and url input value starts with the templateUrl, the text entered by user is part after the templateUrl.\n $scope.formData.connectionInformation.urlUserInput = $scope.formData.connectionInformation.url.substring(templateUrl.length);\n } else {\n // If templateUrl is not empty and url input value don't start with the templateUrl, all url is entered by the user.\n $scope.formData.connectionInformation.urlUserInput = $scope.formData.connectionInformation.url;\n }\n } else {\n // If templateUrl is empty this means that chosen driver is generic or user is not filled hostname, port, or database name.\n // So all characters in url input are entered by user.\n $scope.formData.connectionInformation.urlUserInput = $scope.formData.connectionInformation.url;\n }\n };\n\n const calculateTemplateUrl = () => {\n let url = $scope.selectedDriver.urlTemplate;\n const connectionInformation = $scope.formData.connectionInformation;\n if (connectionInformation.hostName) {\n if (connectionInformation.port) {\n url = url.replace('{hostport}', `${connectionInformation.hostName}:${connectionInformation.port}`);\n } else {\n url = url.replace('{hostport}', `${connectionInformation.hostName}`);\n }\n }\n if (connectionInformation.databaseName) {\n url = url.replace('{database}', connectionInformation.databaseName);\n }\n return url;\n };\n\n const loadSupportedDriversData = () => {\n return RepositoriesRestService.getSupportedDriversData($scope.repositoryInfo)\n .success((response) => {\n $scope.supportedDriversData = response;\n }).error((response) => {\n showErrorMsg($translate.instant('common.error'), response);\n });\n };\n\n const setLoading = (loading) => {\n $scope.formData.settings.ontopFiles.forEach((ontopFile) => {\n ontopFile.loading = loading;\n });\n };\n\n const loadPropertiesFile = () => {\n setLoading(true);\n RepositoriesRestService.loadPropertiesFile($scope.repositoryInfo.params.propertiesFile.value, $scope.repositoryInfo.location, $scope.selectedDriver.driverType)\n .success((driverData) => {\n let driver = $scope.supportedDriversData.find((driver) => driver.driverClass === driverData.driverClass);\n // If driver not found this means that driver is generic.\n // If the driver is found, but the data returned by the server does not contain a hostname,\n // it means that the driver class (which we support) is filled in as the driver class of a generic type.\n if (!driver || !driverData.hostName) {\n driver = $scope.supportedDriversData.find((driver) => $scope.genericDriverType === driver.driverType);\n }\n $scope.selectDriver(driver.driverType);\n $scope.formData.connectionInformation.driverType = driver.driverType;\n $scope.formData.connectionInformation.driverClass = driverData.driverClass;\n $scope.formData.connectionInformation.password = driverData.password;\n $scope.formData.connectionInformation.username = driverData.userName;\n $scope.formData.connectionInformation.url = driverData.url;\n $scope.formData.settings.additionalProperties = driverData.additionalProperties;\n\n if ($scope.genericDriverType !== driver.driverType) {\n $scope.formData.connectionInformation.hostName = driverData.hostName;\n $scope.formData.connectionInformation.databaseName = driverData.databaseName;\n $scope.formData.connectionInformation.port = driverData.port ? parseInt(driverData.port, 10) : undefined;\n }\n\n extractExtraUrl();\n $scope.updateUrl();\n\n Object.values(OntopFileType)\n .forEach((ontopFileType) => {\n const ontopFileInfo = $scope.repositoryInfo.params[ontopFileType];\n const ontopFile = $scope.getOntopFileInfo(ontopFileType);\n if (ontopFileInfo) {\n ontopFile.fileName = getFileName(ontopFileInfo.value);\n }\n });\n $scope.currentOntopRepoInfo = angular.copy($scope.formData);\n })\n .error((data) => {\n showErrorMsg($translate.instant('common.error'), data);\n })\n .finally(() => {\n setLoading(false);\n });\n };\n\n const updatePropertiesFile = () => {\n setLoading(true);\n const connectionInformation = $scope.formData.connectionInformation;\n\n const jdbc = {\n hostName: connectionInformation.hostName,\n port: connectionInformation.port,\n databaseName: connectionInformation.databaseName,\n userName: connectionInformation.username,\n password: connectionInformation.password,\n driverClass: connectionInformation.driverClass,\n url: connectionInformation.url,\n additionalProperties: $scope.formData.settings.additionalProperties\n };\n\n return RepositoriesRestService\n .updatePropertiesFile($scope.repositoryInfo.params.propertiesFile.value, jdbc, $scope.repositoryInfo.location, $scope.selectedDriver.driverType)\n .success((data) => {\n $scope.repositoryInfo.params.propertiesFile.value = data.fileLocation;\n }).error((data) => {\n showErrorMsg($translate.instant('common.error'), data);\n })\n .finally(() => setLoading(false));\n };\n\n const showErrorMsg = (title, data) => {\n const msg = getError(data);\n toastr.error(msg, title);\n };\n\n const validateHostName = () => {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (!$scope.formData.connectionInformation.hostName) {\n return Promise.reject(new OntopRepositoryError($translate.instant('missing.required.field', {fieldName: $translate.instant('ontop.repo.database.host_name')})));\n }\n }\n return Promise.resolve();\n };\n\n const validateDatabaseName = () => {\n if ($scope.selectedDriver.driverType !== $scope.genericDriverType) {\n if (!$scope.formData.connectionInformation.databaseName) {\n return Promise.reject(new OntopRepositoryError($translate.instant('missing.required.field', {fieldName: $translate.instant('ontop.repo.database.database_name')})));\n }\n }\n return Promise.resolve();\n };\n\n const validateDriverClass = () => {\n if (!$scope.formData.connectionInformation.driverClass) {\n return Promise.reject(new OntopRepositoryError($translate.instant('missing.required.field', {fieldName: $translate.instant('ontop.repo.database.driver_class')})));\n }\n return Promise.resolve();\n };\n\n const validateUrl = () => {\n if (!$scope.formData.connectionInformation.url) {\n return Promise.reject(new OntopRepositoryError($translate.instant('missing.required.field', {fieldName: $translate.instant('ontop.repo.database.url')})));\n }\n return Promise.resolve();\n };\n\n const validateRepositoryId = () => {\n if (!$scope.repositoryInfo.id) {\n return Promise.reject(new OntopRepositoryError($translate.instant('empty.repoid.warning')));\n }\n return Promise.resolve();\n };\n\n const validateOntopFiles = () => {\n if (!$scope.getOntopFileInfo(OntopFileType.OBDA).fileName) {\n return Promise.reject(new OntopRepositoryError($translate.instant('ontop.repo.missing.required.file', {fileName: $scope.repositoryInfo.params[OntopFileType.OBDA].label})));\n }\n return Promise.resolve();\n };\n\n const validatePort = () => {\n if ($scope.selectedDriver.portRequired && !$scope.formData.connectionInformation.port) {\n return Promise.reject(new OntopRepositoryError($translate.instant('missing.required.field', {fieldName: $translate.instant('ontop.repo.database.port')})));\n }\n return Promise.resolve();\n };\n\n const clearFormData = () => {\n $scope.formData = {\n connectionInformation: new OntopConnectionInformation(),\n settings: {\n additionalProperties: '',\n ontopFiles: []\n }\n };\n\n Object.values(OntopFileType)\n .forEach((ontopFileType) => {\n const ontopFileInfo = new OntopFileInfo(ontopFileType);\n $scope.formData.settings.ontopFiles.push(ontopFileInfo);\n });\n\n $scope.getOntopFileInfo(OntopFileType.OBDA).required = true;\n };\n\n // =========================\n // Initialize component data\n // =========================\n loadSupportedDriversData()\n .then(() => {\n if ($scope.editRepoPage) {\n loadPropertiesFile();\n } else {\n $scope.selectDriver($scope.genericDriverType);\n }\n });\n }\n}\n"],"sourceRoot":""}